Menu

Custom Search

C++ lab Program

...............
#include
#include
#include
struct student
{

char name[30];
int roll;
float marks[3];

void initialize();
void display();
};

void student::initialize()

{ strcpy(name,"Rajesh");
roll=102;
marks[0]=87;
marks[1]=99;
marks[2]=98;
}

void student::display()
{
cout<<"Name:"< cout<<"Roll:"< cout<<"Mark1:"<
float x=(marks[0]+marks[1]+marks[2])/3;
cout<<"Average mark:"< }
void main()
{
clrscr();
student s;
s.initilize();
s.display();
getch();


}.................

No comments:

Post a Comment