MARKS OF 10 STUDENTS #include<iostream.h> #include<conio.

h> int main() { clrscr(); int marks[10]; for(int i=0;i<50;i++) { cout<<"\n enter the marks of" <<i+1<<"="; cin>>marks[i]; } for(int j=0;j<50;j++) { cout<<marks[j]<<"\n"; } getch(); return(0); }

TO FIND THE FACTORIAL #include<iostream.h> #include<conio.h> int main() { int i,f=1,n; cout<<"please enter the till which no. u want factorial"; cin>>n; for(i=1;i<=n;i++) {f=f*i;} cout<<f; getch(); return(0); }

FIBONACCI SERIES #include<iostream.h> #include<conio.h> int main() { int f,i,n,a=0,b=1; cout<<"please enter the number till which u want the fibonacii series"; cin>>n; if(n==1)

temp. b. } } getch().} else {cout<<"not a palindrome". cout<<"please enter the number".} if(n==2) {cout<<b.} getch(). num=num/10.i++) { f=a+b.". rev=rev*10+r. if(a==1) cout<<"neither prime nor composite".h> int main() { int i. else { . while(num!=0) {r=num%10. cin>>a.{cout<<a. i. return(0).h> #include<conio.h> int main() { int a.h> #include<conio.} if(n>2) { cout<<a<<b. cin>>num.r. return(0). } PALINDROME #include<iostream.num. } if(rev==temp) {cout<<"it is palindrome". b=f. cout<<f . temp=num. } PRIME OR NOT #include<iostream. a=b. for(i=1. cout<<"enter the no.i<=(n-2).rev=0.

int &top. if(res==-1) {cout<<" } void main() { int stack[size]. char ch='y'. } return0. } getch(). res=push(stack. cin>>ch. exit(0).item). while(ch=='y'||ch=='Y') {cout<<"enter item for insertion. i++) { if(a%i==0) { b++. i<=(a/2).top) cout<<"want to insert more". return(0).int top) { for(int i=top. islplay(stack.. int push(int stack[].top=-1. . cin>>item.item.i> item) { if(top==size-1) return-1. else cout<<"\nit is NOT Prime". } } if(b==0) cout<<"\nit is prime".aborting".h> const int size=50.i--) cout<<stack[i]<<endl.b=0. } cout<<"stack now is". else {top++ stack[top]=item. } INSERTION IN STACK #include<iostream. for(i=2.res.h> #include<conio. } void display(int stack[].

delete[]marks. } cout <<"\troll no \tMarks\n". digit++. getch(). marks = new float[size]. cin >>rollno[i]>>marks[i]. } POINTERS MARKS #include<iostream. return 1. if((!rollno)||(!marks)) { cout<<"Out".i.i<size. cout<<"Enter size ".h> #include<conio.i++) cout << "\t"<<rollno[i]<<"\t"<<marks[i]<<"\n".i++) { cout << "enter rollno and marks for " << i+1 << "\n".h> int *rollno. while(num!=0) { num=num/10. cin>>size. } for(i=0. int main() { int size.h> #include<conio. } SWAPING OF NUMBERS #include<iostream.} getch(). . return(0).h> int main() { int num.digit=0. rollno = new int[size].i<size. float *marks. delete[]rollno. } cout<<digit. for(i=0. cout<<"please enter the number". cin>>num.

char ch. enter(). } STRUCTURE 1 #include<iostream. }. // for function void enter(void). char area[26].empno==eno) {display(i). cin>>ch. do { cout<<"\n enter the employ no.getch(). } . whose information is to be displayed".i. int eno. break.h> struct addr { int houseno. void main() { clrscr(). void display(int a).h> #include<conio.i<10. flag=1. getch(). addr address.i++) { if(sales_emp[i]. } while(ch=='y'). } } if(!flag) { cout<<"\nsorry no such employ exist". struct emp { int empno. int flag=0.h> #include<stdio. } cout<<"\n display more(y/n)". return 0. emp sales_emp[10]. cin>>eno. for(i=0. }worker.

name). cout<<"\n employ no.h> #include<conio.area. cin>>sales_emp[i]. cout<<"\n enter area=".address.ave. gets(sales_emp[i].houseno. getch(). else if(ave>50) grade='B'. clrscr(). } getch(). cout<<"please enter the details of the student".". } void display(int a) { cout<<"\n EMPLOY DATA". cout<<sales_emp[a].address. cout<<"\n employ address =". gets(s1. .rollno. char grade. cout<<"please enter the marks of all 5 subjects ". } ave=total/5."<<sales_emp[a].i<5. }s1.marks[i]. for(int i=0.= ". int rollno.void enter(void) { for(int i=0. } STRUCTURE 2 #include<iostream. cout<<"\nenter house no.empno.empno.i++) {cout<<"\nenter employ no.i<10. cin>>sales_emp[i].h> struct result { char name[26].h> #include<stdio. void main() { float total=0. if(ave>75) grade='A'. total=total+s1.=".address. cin>>s1.marks[i]. float marks[5].area).i++) { cin>>s1.address.houseno<<sales_emp[a]. cout<<"\n ROLL NO. cout<<"\nenter address". cout<<"\n NAME=".

h> #include<conio.feet+(l1. cin>>length2. } void prnsum(distance l1.inches=(l1.feet<<"\n".rollno<<"\n NAME="<<s1. distance length1. cout<<"\n inches". l3. cout<<"\n enter length 2"<<"\n feet". getch().length2).feet+l2. cin>>length2.feet.h> #include<conio. getch().inches+l2.h> #include<string. int inches. cout<<"total inches:"<<l3.h> #include<stdio.h> #include<stdio. cin>>length1. cout<<"\n inches".h> #include<ctype.h> void main() { clrscr(). void prnsum(distance l1. cout<<"\n the result of the student is with the following information".inches.inches.feet.//1 feet=12 inches l3.h> struct distance { int feet. cout<<"enter length 1"<<"\n feet".inches+l2. char string[20].inches)%12.inches. } STRUCTURE 3 #include<iostream.feet=l1.inches)/12.distance l2) { distance l3. }. else grade='F'. cin>>length1. prnsum(length1. .distance l2). getch(). cout<<"\nROLL NO. cout<<"\n\n\n Total feet:"<<l3. } TO UPPERCASE #include<<<"\n grade="<<grade<<"\n TOT AL MARKS ="<<total.length2.="<<s1.else if(ave>35) grade='C'. void main() { clrscr().

gets(string). public: void in(). float sum(). float largest_1(). for(int i=0.i<len. cin>>icode[i]. for(int i=0.cout<<"please enter the string".i<5.i<5. for(int i=0.h> class item { int icode[5]. void item::in() { cout<<"please enter the details".h> #include<conio.i++) { string[i]=toupper(string[i]).i++) { cout<<"\nitem code"<<i+1<<"=".i++) { if(iprice[i]>large) large=iprice[i]. . } float item::largest_1(void) { float large=iprice[0]. } cout<<string. for(int i=0. cin>>iprice[i].i++) sum=sum+iprice[i]. cout<<"\nitem pice"<<i+1<<"=". return sum. getch(). } return large.i<5. } float item::sum(void) { float sum=o. float iprice[5]. } CLASS 1 #include<iostream. int len=strlen(string). } void main() {clrscr(). }.

getch().sum().j++) { cout<<"enter the value of row"<<i+1<<"and column"<<j+1.s++) { for(int j=0. . cin>>matric2[i][j]. int matric2[3][3].j++) {if(matric1[s][j]!=matric2[s][j]) flag++.s<3.h> #include<stdio.h> void main() { clrscr().j<3.h> void main() { clrscr().h> #include<conio. for(int k=0. } REVERSING OF STRING #include<iostream. cout<<"largest="<<i. } } if(flag==0) cout<<"the given matrixes are equivalent".largest_1().k++) { cout<<"enter the value of row"<<i+1<<"and column"<<k+1.h> #include<string. int k. cout<<"enter the value of matric1". } } int flag=0. getch().i++) { for(int j=0. cout<<"sum="<<i. for(int s=0. cin>>matric1[i][j].k<3.h> #include<conio. } EQUALITY OF MATRICES #include<iostream. } cout<<"please enter the values of 2nd matric". for(int i=0. int matric1[3][3].h> #include<Stdio.item i.i<3.j<3. else cout<<"not".

}} cout<<"the list of reversed string are\n".i++) { cin. getch(). } .i++) cout<<string[i]<<endl.j<len/2.i<3. for(int {string[i][j]=string[i][k]. } cout<<"\the strings entered by you are".i++) { int len=strlen(string[i]).i<3. cout<<"please enter the 3 string ".i<3. for( i=0.char string[3][80]. for( i=0. k=len-1.i<3.40).i++) { cout<<string[i].getline(string[i]. string[i][k]=ch.j++. } for( i=0. for(int j=0.