Write a program to find given number is even or odd without
using any control statement.

Answer Posted / saneemask

main()
{

{
char a[][5]= {"Even","Odd"};
int n;
printf("Enter any no.: ");
scanf("%d",&n);
printf("%s",a[n%2]);
getch();
}
{

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

685


What is the code for 3 questions and answer check in VisualBasic.Net?

1686


How many levels of pointers can you have?

697


Write a program to identify if a given binary tree is balanced or not.

680


Explain how can I prevent another program from modifying part of a file that I am modifying?

633






What is the explanation for the dangling pointer in c?

673


How can I direct output to the printer?

808


Is multithreading possible in c?

562


What is call by reference in functions?

560


Can I initialize unions?

590


How can I find out how much free space is available on disk?

624


What is the difference between variable declaration and variable definition in c?

564


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

667


How do I swap bytes?

628


Are c and c++ the same?

623