find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / rohit agarwal
#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What is a char in c?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What is the right type to use for boolean values in c?
Is it fine to write void main () or main () in c?
What is huge pointer in c?
Can we use visual studio for c?
what value is returned to operating system after program execution?
How can I pad a string to a known length?
Write a factorial program using C.
What is volatile variable in c?
What is struct node in c?
What is page thrashing?
Why is it usually a bad idea to use gets()? Suggest a workaround.
Can we replace the struct function in tree syntax with a union?