Friday, June 27, 2008

ABOUT ME

IAM SATNAM SINGH.
BELONGING TO VILLAGE (PAKHOWAL).
I WANT TO HELP THOSE WHO NEEDED.
I AM SIMPLIEST.

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();
}

Wednesday, June 25, 2008

arrays

#include
#include
void main()
{
int i,j,m,n,a[20][20];
cin>>m>>n;
for(i=0;i{
for(j=0;jcin>> a[i][j];
for(i=0;i{
cout<for(i=0;i{ cout<<"/t";
cout<}}}
getch(); }

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;