Beruflich Dokumente
Kultur Dokumente
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
int i,j,num[4][4];
for(i=0;i<3;i++)
{ for(j=0;j<3;j++)
cin>>num[i][j];
} }
for(i=0;i<3;i++)
{ for(j=0;j<3;j++)
{ cout<<num[i][j]<<" ";
cout<<"\n";
getch();
}
Q. Write a program to encrypt and decrypt a string.
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
clrscr();
char str[50];
cout<<"Enter A String=>";
gets(str);
for(int i=0;str[i]!='\0';i++)
{ str[i]=str[i]+3;
cout<<"\nEncrypted String=>"<<str;
for(int j=0;str[j]!='\0';j++)
{ str[j]=str[j]-3;
cout<<"\nDecrypted String=>"<<str;
getch();
#include<conio.h>
void main()
{ clrscr();
int num[5],size,n;
cout<<"Length Of String=>";
cin>>size;
for(int i=0;i<size;i++)
{ cin>>num[i];
cin>>n;
lsearch(num,size,n);
getch();
{ int flag=0;
for(int i=0;i<size;i++)
{ if(num[i]==n)
{ flag=1;
break;
}
if(flag==0)
cout<<"Not Found";
else
#include<conio.h>
#include<string.h>
#include<stdio.h>
void main()
clrscr();
char str[50];
int l,i;
cout<<"Enter a String=>";
gets(str);
l=strlen(str);
cout<<l;
for(i=l-1;i>=0;i--)
{ cout<<str[i];
getch();
#include<conio.h>
{ clrscr();
int p,r,t;
cin>>p;
cin>>r;
cin>>t;
simple(p,r,t);
getch();
{ int si=(p1*r1*t1)/100;
cout<<"Simple Interest="<<si;
#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
clrscr();
char str[20];
int l,flag=0;
gets(str);
l=strlen(str);
for(int i=0,j=l-1;str[i]!='\0',j>=0;i++,j--)
{ if(str[i]!=str[j])
{ flag=1;
break;
}}
if(flag==1)
cout<<"Not a palindrome";
else
cout<<"It is a palindrome";
getch(); }
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
int x,y;
cin>>x>>y;
swap(x,y);
getch();
{ int temp;
temp=a;
a=b;
b=temp;
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
void main()
{
clrscr();
char str[50];
int v=0;
cout<<"Enter a String=>";
gets(str);
for(int i=0;str[i]!='\0';i++)
{ switch(str[i])
{ case 'A':
case 'a':
case 'E':
case 'e':
case 'I':
case 'i':
case 'O':
case 'o':
case 'U':
case 'u':v++;
cout<<"Number Of Vowels="<<v;
getch();
}
Q. Write a program to add 2 arrays using structure.
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
struct call
{ int a[2][2];
int b[2][2];
int c[2][2];
}ob;
void main()
{ clrscr();
{ for(int i=0;i<2;i++)
{ for(int j=0;j<2;j++)
{ cin>>ob.a[i][j];
}}}
{ for(int i=0;i<2;i++)
{ for(int j=0;j<2;j++)
{ cin>>ob.b[i][j];
}}}
{ for(int i=0;i<2;i++)
{ for(int j=0;j<2;j++)
{ ob.c[i][j]=ob.a[i][j]+ob.b[i][j];
}}}
cout<<"\n\nSum: ";
{ for(int i=0;i<2;i++)
{ for(int j=0;j<2;j++)
{ cout<<" "<<ob.c[i][j];
}}}
getch();
#include<conio.h>
#include<string.h>
#include<stdio.h>
#include<process.h>
#include<dos.h>
void gtdata();
void display();
void search();
void searchno();
void searchname();
void edit();
void pass();
void bill();
int count=0,q=0;
struct map
int sn;
char name[20];
int price;
int quan;
ob[3];
void main()
clrscr();
pass();
clrscr();
cout<<"\n\n\n\n\n";
cout<<" ##########################"<<"\n";
delay(250);
cout<<" # #"<<"\n";
delay(250);
cout<<" # #"<<"\n";
delay(250);
cout<<" # S";
delay(200);
cout<<"E";
delay(200);
cout<<"A";
delay(200);
cout<<"H";
delay(200);
cout<<"A";
delay(200);
cout<<"W";
delay(200);
cout<<"K";
delay(200);
cout<<" #"<<"\n";
delay(250);
cout<<" # #"<<"\n";
delay(250);
cout<<" # E";
delay(200);
cout<<"X";
delay(200);
cout<<"P";
delay(200);
cout<<"O";
delay(200);
cout<<"R";
delay(200);
cout<<"T";
delay(200);
cout<<"S";
delay(200);
cout<<" Ltd.";
delay(200);
cout<<" #"<<"\n";
delay(250);
cout<<" # #"<<"\n";
delay(250);
cout<<" # #"<<"\n";
delay(250);
cout<<" ##########################"<<"\n";
delay(250);
cout<<" ";
delay(800);
int ch=0;
do
clrscr();
delay(250);
cout<<"\n\n1.Add Product";
cout<<"\n2.Display Project";
cout<<"\n3.Search Record";
cout<<"\n4.Edit Record";
cout<<"\n5.Print Bill";
cout<<"\n6.<EXIT>";
cin>>ch;
switch(ch)
case 1:gtdata();
break;
case 2:display();
break;
case 3:search();
break;
case 4:edit();
break;
case 5:bill();
break;
case 6:exit(0);
while(ch<=4);
void gtdata()
clrscr();
for(int i=0;i<3;i++)
count++;
ob[i].sn=count;
cout<<"\nItem "<<count;
gets(ob[i].name);
cin>>ob[i].price;
cin>>ob[i].quan;
getch();
}
void display()
clrscr();
int c=0;
c++;
for(int i=0;i<3;i++)
cout<<"\n\nItem "<<c++;
cout<<"\nPrice: "<<ob[i].price;
cout<<"\nQuatity: "<<ob[i].quan;
cout<<"\nBarcode: ";
cout<<"\n || | |||";
getch();
void search()
clrscr();
int z=0;
cin>>z;
switch(z)
case 1:searchno();
break;
case 2:searchname();
getch();
void searchname()
clrscr();
int i,flag;
char ch[20];
gets(ch);
for(i=0;i<3;i++)
if(strcmpi(ob[i].name,ch)==0)
{ flag=1;
break;
if(flag==1)
else
getch();}
void searchno()
clrscr();
int y,i,flag;
cin>>y;
if(ob[i].sn==y)
flag=1;
break;
if(flag==1)
else
getch();
void pass()
char p[10];
gets(p);
if(strcmpi(p,"Abhishek")==0)
cout<<".";
delay(350);
cout<<".";
delay(450);
cout<<".";
delay(550);
else
{
cout<<".";
delay(350);
cout<<".";
delay(450);
cout<<".";
delay(550);
exit(0);
void edit()
clrscr();
int flag=0;
char name1[20];
gets(name1);
for(int i=0;i<3;i++)
if(strcmpi(ob[i].name,name1)==0)
cout<<"\nPrice: "<<ob[i].price;
cout<<"\nQuantity: "<<ob[i].quan;
getch();
flag=1;
gets(ob[i].name);
cin>>ob[i].price;
cin>>ob[i].quan;
if(flag==0)
getch();
void bill()
int sum=0;
clrscr();
cout<<"##################################################################
#####";
cout<<"\n\n";
for(int i=0;i<3;i++)
cout<<"\nPrice: "<<ob[i].price;
cout<<"\nQuatity: "<<ob[i].quan;
sum=sum+(ob[i].quan*ob[i].price);
cout<<"\nBill generated";
getch();