Lalit Oops
Lalit Oops
Lalit Oops
E
TOOPS
FILE
SUBMITTED TO: SUBMITTED BY:
Mrs. Kiran arora Lalit Mohan
CSE(3 rd sem)
Roll no. 90070302383
(9123)
LALIT
A PROGRAM FOR HIGHER AND LOWER ELEMENTS OF ARRAY
#include<iostream.h>
#include<conio.h>
void main()
int a[5],i,j,n,k;
cin>>n;
cin>>a[i];
if(i!=j)
if (a[i]>a[j])
int temp;
LALIT
temp=a[i];
a[i]=a[j];
a[j]=temp;
}}
LALIT
PROGRAM FOR ADDITION OF MATRIC'S
#include<iostream.h>
#include<conio.h>
void main()
int m,n,i,j;
int a[20][20],b[20][20];
cin>>m;
cout<<"enter no of colums";
cin>>n;
{ cin>>a[i][j];}
cout<<endl;
{ cin>>b[i][j];}
LALIT
cout<<"* First Matrix is : "<<endl;
cout<<a[i][j]<<" ";
cout<<endl;
cout<<b[i][j]<<" ";
cout<<endl;
int c[20][20];
{ c[i][j]=a[i][j]+b[i][j];
cout<<c[i][j]<<" ";}
LALIT
cout<<endl;
}}
LALIT
A PROGRAM TO CALCULATE TOTAL CHARACTAR OF STRING
#include<iostream.h>
#include<conio.h>
void main()
int c=0,i=0;
char a[50];
cin>>a;
for(i=0;a[i]!='\0';++i)
if((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z'))
++c;
else
continue;
getch();
LALIT
}
LALIT
A PROGRAM TO PRINT PRIME NUMBER
#include<iostream.h>
#include<conio.h>
void main()
clrscr();
int i,n,j;
cin>>j;
else if(i==n-1)
cout<<n<<endl;
}//Prime number !
getch();
LALIT
LALIT
A PROGRAM FOR PRODUCT OF DOUBLE MATRICES
#include<iostream.h>
#include<conio.h>
void main()
int m,n,o,i,j;
cin>>m;
cin>>n;
cin>>o;
cin>>a[i][j];
}}
LALIT
{
cin>>b[i][j];
}}
cout<<a[i][j]<<" ";
cout<<endl;
cout<<b[i][j]<<" ";
cout<<endl;
int c[10][10];
LALIT
for(j=1; j<=o; j++)
c[i][j]=c[i][j]+(a[i][k]* b[k][j]);
}cout<<c[i][j]<<" ";
cout<<endl;}
LALIT
PROGRAM FOR FACTORIAL OF GIVEN NUMBER
A#include<iostream.h>
#include<conio.h>
main()
int i,k=1,n;
clrscr();
cin>>n;
for(i=1;i<=n;i++)
k=k*i;
cout<<k<<endl;
k=1;
getch();
LALIT
LALIT
A PROGRAM FOR SUM OF ARRAY
#include<iostream.h>
#include<conio.h>
void main()
int temp=0,a[50],i,n;
cin>>n;
for(i=1;i<=n;i++)
cin>>a[i];
for(i=1;i<=n;i++)
temp=temp+a[i];
getch();
LALIT
LALIT
A PROGRAM TO CONVERT TEMPERATURE IN FARENHIET TO
CELSIUS
#include<iostream.h>
#include<conio.h>
void main()
int cels,n;
cin>>n;
cels=(n-32)/1.8;
getch();
LALIT
A PROGRAM FOR COMBINATION FORMULA
#include<iostream.h>
#include<conio.h>
main()
int i,n,r,c,j=1,k=1,h=1;
cin>>n;
cin>>r;
for(i=1;i<=n;i++)
j=j*i;
for(i=1;i<=r;i++)
k=k*i;
for(i=1;i<=n-r;i++)
LALIT
{
h=h*i;
c=j/(k*h);
cout<<c;
LALIT
A PROGRAM FOR STORING ADDRESS OF ELEMENT IN ARRAY
#include<iostream.h>
#include<conio.h>
void main()
int a[50],i,n;
cin>>n;
for(i=1;i<=n;i++)
cin>>a[i];
for(i=1;i<=n;i++)
getch();
LALIT
LALIT
A PROGRAM FOR SORTING STRING ELEMENTS
#include<iostream.h>
#include<conio.h>
Void main()
int i,j,temp,n;
char a[7];
for(i=1;i<=7;i++)
cin>>a[i];
for(i=1;i<7;i++)
for(j=1;j<=7;j++)
if(a[j]>a[j+1])
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
} }
LALIT
for(i=1;i<=7;i++)
cout<<a[i]<<" ";
LALIT
A PROGRAM FOR ADDITION OF TWO MATRICES
#include<iostream.h>
#include<conio.h>
void main()
int m,n,i,j;
int a[20][20],b[20][20];
cin>>m;
cout<<"enter no of colums";
cin>>n;
{ cin>>a[i][j];}
cout<<endl;
{ cin>>b[i][j];}
LALIT
for(i=1; i<=m; i++)
cout<<a[i][j]<<" ";
cout<<endl;
cout<<b[i][j]<<" ";
cout<<endl;
int c[20][20];
{ c[i][j]=a[i][j]+b[i][j];
cout<<c[i][j]<<" ";}
cout<<endl;
LALIT
}}
LALIT
A PROGRAM FOR REVERSING THE ELEMENTS
#include<iostream.h>
#include<conio.h>
void main()
int rev,j,n;
cin>>n;
while(n>0)
rev=n%10;
cout<<rev;
n=n/10;
getch();
LALIT
LALIT
A PROGRAM FOR CHECKING MULTIPLE OF NUMBERS
#include<iostream.h>
#include<conio.h>
void main()
int i,n;;
cin>>n;
cin>>i;
if(n%i==0)
else
getch();
LALIT
LALIT
A PROGRAM TO CHECK IF STRING IS PALINDROME OR NOT
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
char n[50];
cin>>n;
strrev(n);
getch();
LALIT
LALIT
A PROGRAM TO PRINT REVERSE OF STRING
#include<iostream.h>
#include<conio.h>
void main()
int rev,j,n;
cin>>n;
while(n>0)
rev=n%10;
cout<<rev;
n=n/10;
getch();
LALIT
LALIT
A PROGRAM TO CHECK MULTIPLE OF NO.
#include<iostream.h>
#include<conio.h>
void main()
int i,n;;
cin>>n;
cin>>i;
if(n%i==0)
else
getch();
LALIT
LALIT
A PROGRAM TO PRINT REVERSE STRING
#include<iostream.h>
#include<conio.h>
void main()
int rev,j,n;
cin>>n;
while(n>0)
rev=n%10;
cout<<rev;
n=n/10;
getch();
LALIT
LALIT
A PROGRAM TO CHECK IF STRING IS PALINDROME OR NOT
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
char n[50];
cin>>n;
strrev(n);
getch();
LALIT
A PROGRAM OF SERIES x+x^2/2+x^3/3…..
#include<iostream.h>
#include<conio.h>
#include<math.h>
main()
int n,i,j=1,k;
float c;
cin>>n;
for(i=1;i<=5;i++)
if(i%2!=0)
j=j*i;
c=pow(n,i)/j;
} }
getch();
LALIT
LALIT
A PROGRAMMNING SHOWS A PALINDROME OR NOT
#include<iostream.h>
#include<conio.h>
main()
int a,temp,d,rev=0;
clrscr();
cin>>a;
temp=a;
while(temp>0)
d=temp%10;
temp/=10;
rev=rev*10+d;
if(rev==a)
cout<<a<<"is palindrome";
else
getch();
LALIT
LALIT