find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / vinocit
#include<stdio.h>
int main()
{
int n=10000;
char *s[2]={"Even","Odd"};
printf("%s",s[n&1]);
return 0;
}
| Is This Answer Correct ? | 47 Yes | 11 No |
Post New Answer View All Answers
What is structure packing in c?
What is register variable in c language?
What is a pointer variable in c language?
how should functions be apportioned among source files?
How do you override a defined macro?
What is the difference between array_name and &array_name?
What is #include conio h?
How can I find out how much free space is available on disk?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What are the 3 types of structures?
What is a loop?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
What is sizeof in c?
How to declare a variable?
What is union and structure in c?