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

Differentiate between full, complete & perfect binary trees.

671


What is the difference between union and structure in c?

576


How many levels of indirection in pointers can you have in a single declaration?

595


What is a macro, and explain how do you use it?

629


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

655






Define Spanning-Tree Protocol (STP)

643


How can you check to see whether a symbol is defined?

592


What is array within structure?

585


What is output redirection?

692


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1844


What is main () in c language?

597


What are the two forms of #include directive?

644


What does c in a circle mean?

583


Explain how do you use a pointer to a function?

640


Can I initialize unions?

594