Computer Practical File
Computer Practical File
for (i=0;i<n;i++)
{
cout<<a[i]<<"
}
getch();
}
";
for (i=0;i<n;i++)
{
cout<<a[i]<<"
}
getch();
}
";
{
cout<<a[i]<<" ";
}
getch();
}
for (i=0;i<10;i++)
{
cout<<a[i]<<" ";
}
getch();
}
k++;i++;
}
else if (b[j]<a[i])
{
c[k]=b[j];
k++;j--;
}
else
{
c[k]=a[i];
k++;i++;j--;
}
}
while (i<=4)
{
c[k]=a[i];
k++;i++;
}
while (j>=0)
{
c[k]=b[j];
k++;j--;
}
cout<<"merged array is";
for(i=0;i<10;i++)
{
cout<<c[i]<<" ";
}
getch();
}
c[k]=a[i];
k++;i--;
}
else if (b[j]>a[i])
{
c[k]=b[j];
k++;j++;
}
else
{
c[k]=a[i];
k++;i--;j++;
}
}
while (i>=0)
{
c[k]=a[i];
k++;i--;
}
while (j<5)
{
c[k]=b[j];
k++;j++;
}
cout<<"merged array is";
for(i=0;i<10;i++)
{
cout<<c[i]<<" ";
}
getch();
}
{
cout<<"element is not found";
}
getch();
}
break;
}
}
if(flag==1)
cout<<"element found at"<<mid+1;
else
cout<<"not found";
getch();
{
for (j=0;j<3;j++)
{
c[i][j]=a[i][j]+b[i][j];
}
}
cout<<"addition is \n";
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
cout<<c[i][j]<<" ";
}
cout<<"\n";
}
getch();
}
}
}
cout<<"transpose of a matrix is=\n";
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
cout<<a[j][i];
}
cout<<"\n";
}
getch();
}
q=q->next;
}
cout<<"\n "<<q->country;
}
}
void pop()
{
if(strt==NULL)
{
cout<<"NO Stack created" ;
}
else
{
cout<<"\nValue Poped is "<<strt->country;
q=strt;
strt=strt->next;
delete q;
}
}
void main()
{
clrscr();
strt=NULL; int
i;
for(i=0;i<5;i++)
push(); pop();
pop();
pop();
disp();
getch();
}
else
{
rear->next=p;
rear=p;
}
}
void disp()
{
if(front==NULL)
{
cout<<"\nNo Queue created" ;
}
else
{
q=front; while(q>next!=NULL)
{
cout<<" \n"<<q->city;
q=q->next;
}
cout<<" \n"<<q->city;
}
}
void deleteq()
{
if(front==NULL&&rear ==NULL)
{
clrscr();
C obj;
obj.getdata2();
obj.display2();
getch();
}
}};
class C: public Triangle,public circle
{
public:
void display1()
{
cout<<"\narea of triangle= "<<area1<<endl;
}
void display2()
{
cout<<"\narea of circle= "<<area2<<endl;
}};
void main()
{
clrscr();
C obj1,obj;
obj1.getdata1();
obj1.display1();
obj.getdata2();
obj.display2();
getch();
}
cin>>b;
}
void display1()
{
display();
cout<<"b="<<b;
}
};
void main()
{
clrscr();
B obj;
obj.getdata1();
obj.display1();
getch();
}
char ch;
while(!f1.eof())
{
f1>>ch;
if(ch=='A')
{
count++;
}
}
cout<<"Total number of alphabet A is"<<\t<<count;
getch();
char ch[20];
while(!f1.eof())
{
f1>>ch;
count++;
}
cout<<"Total number of blank spaces is "<<count-1;
f1.close();
getch();
}