find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / shashi
#include<stdio.h>
main()
{
int n;
string s[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",s[n]);
}
Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
How to write a code for reverse of string without using string functions?
What functions are used for dynamic memory allocation in c language?
Explain what are the standard predefined macros?
What is an example of structure?
which is an algorithm for sorting in a growing Lexicographic order
How to find a missed value, if you want to store 100 values in a 99 sized array?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is the best way of making my program efficient?
What is the purpose of 'register' keyword?
what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)
Can a pointer point to null?
What is volatile variable in c with example?
What is the use of pointers in C?
Difference between strcpy() and memcpy() function?
Are local variables initialized to zero by default in c?