"The best way to cheer yourself up is to try to cheer somebody else up." Mark Twain

Tuesday, February 9, 2010

Write a program to enter the names and monthly salaries of 10 employees in a company. Now check individual per annum salary. If annual salary is greater than or equal to Rs 2,50000/- , then print name, salary and a message 'tax to be paid'; else print name, salary, and a message 'no tax'.


#include<iostream.h>
#include<conio.h>

void main()
{
char emp_nm[10], mon_sal[10];

/* ....Input .... */

for(int i = 0; i< 10; i++)
{
cout<<"\n enter the name of an employee :";
cin >> emp_nm[i];

cout<<"\n Enter the salary :";
cin>>mon_sal[i];
}


cout<< "Name" << "\t\t" << "Salary" << endl;
for(i = 0; i< 10; i++)
{


// Check annual salary ....
if(mon_sal[i]*12 >= 250000)
   cout<< emp_nm[i] << "\t\t"<< mon_sal[i] << "tax-to-be-paid"<< "\n" ;
else
   cout<< emp_nm[i] << "\t\t"<< mon_sal[i] << "no-tax"<< "\n" ;
}

getch();
}

No comments:

Post a Comment

C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.
Now Playing: Ballade Pour Adeline

About Me

My photo
I m an IT lecturer of a college. I love social-work. I want to do something beneficial for society before dying , that can promote our society, to some extent.