C++ Program For Bca
C++ Program For Bca
or not..
#include <stdio.h>
int main()
{
int number, sum = 0, temp, remainder;
cout<<Enter an integer\n;
cin>>number;
temp = number;
while( temp != 0 )
{
remainder = temp%10;
sum = sum + remainder*remainder*remainder;
temp = temp/10;
}
if ( number == sum )
cout<<Entered number is an armstrong number.\n;
else
cout<<Entered number is not an armstrong number.\n;
return 0;
}
cout<<****
1.ADDITION
cout<<****
2.SUBTRACTION
cout<<****
3.MULTIPLY
cout<<****
4.DIVISION
****\n;
****\n;
****\n;
****\n;
****\n;
cout<<*******************************************\n;
do
{
cout<< ENTER YOUR CHOICE \n;
cin>>ch;
cout<<\n;
switch(ch)
{
case 1:cout<< YOU CHOOSE ADDITION\n\n;
cout<< Enter first number \n\n;
cin>>a;
cout<< Enter second number \n\n;
cin>>b;
c=a+b;
cout<<a<< + <<b<< = <<c;
break;
case 2:cout<< YOU CHOOSE SUBTRACTION\n;
cout<< Enter first number \n\n;
cin>>a;
cout<< Enter second number \n\n;
cin>>b;
c=a-b;
cout<< a<< <<b<< = <<c;
break;
case 3:cout<< YOU CHOOSE MULTIPLY\n;
cout<< Enter first number \n\n;
cin>>a;
cout<< Enter second number \n\n;
cin>>b;
c=a*b;
cout<<a<<X<<b<< =<<c;
break;
case 4:cout<< YOU CHOOSE DIVISION\n \n;
*\n;
cin>>a;
if(a>=65 && a<=91)
{
cout<<* WOW !! LOWER CASE IS : <<c
cout<<*************************************\n;
}
else
{
cout<<*ERROR !! *\n YOU HAVE NOT ENTERED A ALPHBET \n*;
cout<<*************************************\n;
}
getch();
}
a[c] = b[c];
cout<<Reverse array is\n;
for (c = 0; c < n; c++)
cout<<a[c];
return 0;
getch();
}
{
for ( d = 0 ; d < n ; d++ )
cout<<sum[c][d];
cout<<\n;
}
return 0;
}
public:
void get1()
{
cout<<"Enter the basic pay:";
cin>>bp;
cout<<"Enter the Humen Resource Allowance:";
cin>>hra;
cout<<"Enter the Dearness Allowance :";
cin>>da;
cout<<"Enter the Profitablity Fund:";
cin>>pf;
}
void calculate()
{
np=bp+hra+da-pf;
}
void display()
{
cout<<eno<<"\t"<<name<<"\t"<<des<<"\t"<<bp<<"\t"<<hra<<"\t"<<da<<"\t
"<<pf<<"\t"<<np<<"\n";
}
};
void main()
{
int i,n;
char ch;
salary s[10];
clrscr();
cout<<"Enter the number of employee:";
cin>>n;
for(i=0;i<n;i++)
{
s[i].get();
s[i].get1();
s[i].calculate();
}
cout<<"\ne_no \t e_name\t des \t bp \t hra \t da \t pf \t np \n";
for(i=0;i<n;i++)
{
s[i].display();
}
getch();
}
case 'E' :
case 'I' :
case 'O' :
case 'U' :cout<<Character is vowel;
break;
default: cout<<Character is consonant;
break;
}
// }
// else
//
cout<<Character is incorrect;
getch();
}