find a number whether it is even or odd without using any
control structures and relational operators?

Answer Posted / vamsi

#include<stdio.h>
main()
{
int n;
string p[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);

}

Is This Answer Correct ?    13 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i got 75% in all semester am i eligible for your company

1988


What does %d do?

981


When do we get logical errors?

887


What are the types of data files?

965


What do you mean by c what are the main characteristics of c language?

821


What is a pointer in c?

1042


explain what are actual arguments?

863


Explain Function Pointer?

937


Where static variables are stored in memory in c?

785


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

949


What are bitwise shift operators in c programming?

868


How many header files are in c?

798


Are there namespaces in c?

829


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

4885


How can I direct output to the printer?

1097