IAM SATNAM SINGH.
BELONGING TO VILLAGE (PAKHOWAL).
I WANT TO HELP THOSE WHO NEEDED.
I AM SIMPLIEST.
Friday, June 27, 2008
TO COMPUTE PROGRAM OF % OF CLASS
#include
#include
#include
class student
{
int rollno,marks[5];
char name[20],class_status[8];
float per;
float calculate ()
{
int i,sum=0;
float p;
#include
#include
#include
class student
{
int rollno,marks[5];
char name[20],class_status[8];
float per;
float calculate ()
{
int i,sum=0;
float p;
for (i=0;i<5;i++)
sum+=marks[i];
p=sum/5;
return p;
}
public:
void takedata()
{
int i;
cout<<"enter roll no";
cin>>rollno;
cout<<"enter name";
gets(name);
cout<<"enter class status ";
gets(class_status);
cout<<"enter marks for 5 subjects";
for (i=0;i<5;i++)
{
cout<<"\n enter ";
cin>>marks[i];
}
per=calculate();
}
void displaydata()
{
int i;
cout<<"\n the details of status are";
cout<<"\n roll no"< cout<<"\n class status " < cout<<"\n name"< cout<<"\n marks for 5 subjects ";
for (i=0;i<5;i++)
cout<<"\n"< cout<<"\n percentage "< }
}s;
void main()
{
clrscr();
s.takedata();
s.displaydata();
getch();
}
for (i=0;i<5;i++)
sum+=marks[i];
p=sum/5;
return p;
}
public:
void takedata()
{
int i;
cout<<"enter roll no";
cin>>rollno;
cout<<"enter name";
gets(name);
cout<<"enter class status ";
gets(class_status);
cout<<"enter marks for 5 subjects";
for (i=0;i<5;i++)
{
cout<<"\n enter ";
cin>>marks[i];
}
per=calculate();
}
void displaydata()
{
int i;
cout<<"\n the details of status are";
cout<<"\n roll no"< cout<<"\n class status " < cout<<"\n name"< cout<<"\n marks for 5 subjects ";
for (i=0;i<5;i++)
cout<<"\n"< cout<<"\n percentage "< }
}s;
void main()
{
clrscr();
s.takedata();
s.displaydata();
getch();
}
#include
#include
class student
{
int rollno,marks[5];
char name[20],class_status[8];
float per;
float calculate ()
{
int i,sum=0;
float p;
#include
#include
#include
class student
{
int rollno,marks[5];
char name[20],class_status[8];
float per;
float calculate ()
{
int i,sum=0;
float p;
for (i=0;i<5;i++)
sum+=marks[i];
p=sum/5;
return p;
}
public:
void takedata()
{
int i;
cout<<"enter roll no";
cin>>rollno;
cout<<"enter name";
gets(name);
cout<<"enter class status ";
gets(class_status);
cout<<"enter marks for 5 subjects";
for (i=0;i<5;i++)
{
cout<<"\n enter ";
cin>>marks[i];
}
per=calculate();
}
void displaydata()
{
int i;
cout<<"\n the details of status are";
cout<<"\n roll no"<
for (i=0;i<5;i++)
cout<<"\n"<
}s;
void main()
{
clrscr();
s.takedata();
s.displaydata();
getch();
}
for (i=0;i<5;i++)
sum+=marks[i];
p=sum/5;
return p;
}
public:
void takedata()
{
int i;
cout<<"enter roll no";
cin>>rollno;
cout<<"enter name";
gets(name);
cout<<"enter class status ";
gets(class_status);
cout<<"enter marks for 5 subjects";
for (i=0;i<5;i++)
{
cout<<"\n enter ";
cin>>marks[i];
}
per=calculate();
}
void displaydata()
{
int i;
cout<<"\n the details of status are";
cout<<"\n roll no"<
for (i=0;i<5;i++)
cout<<"\n"<
}s;
void main()
{
clrscr();
s.takedata();
s.displaydata();
getch();
}
Wednesday, June 25, 2008
arrays
c++
#include
#include
void main()
{
int x,y,*p1,*p2;
void exchange (int,int);
cout<<"/n enter x & y";
cin>>x>>y;
p1=&x;
p2=&y;
cout<<"/n before exchange X="< exchange (p1,p2)
cout<<"/n after exchange x="<<*p1<<"and y=<<*p2;
getch();
}
void exchange (int and p3,int and p4)
{
int temp;
temp=*p3
*p3=*p4
*p4=temp;
return;
#include
void main()
{
int x,y,*p1,*p2;
void exchange (int,int);
cout<<"/n enter x & y";
cin>>x>>y;
p1=&x;
p2=&y;
cout<<"/n before exchange X="<
cout<<"/n after exchange x="<<*p1<<"and y=<<*p2;
getch();
}
void exchange (int and p3,int and p4)
{
int temp;
temp=*p3
*p3=*p4
*p4=temp;
return;
Subscribe to:
Posts (Atom)