write a program for even numbers?

Answer Posted / shahbaz

void main()
{
int a,b;
cout<<"Enter number to check is it Even or Odd";
cin>>a;
if(a>=0)
{
if(a%2==0)
{
cout<<"The number is Even ";
}
else
{
cout<<"Number is Odd ";
}
}
else
{
Cout<<"Number is Lesser than Zero 0";;
}
getch();
}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are loops c?

616


How pointers are declared?

560


please send me the code for multiplying sparse matrix using c

1725


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

974


What is the need of structure in c?

565






What does a function declared as pascal do differently?

607


Where static variables are stored in c?

585


What is static identifier?

704


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1727


Explain the Difference between the New and Malloc keyword.

688


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

669


What is atoi and atof in c?

617


What is meant by errors and debugging?

647


Why pointers are used?

633


how logic is used

1498