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
Is null valid for pointers to functions?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
Can we access the array using a pointer in c language?
What is a pointer variable in c language?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
How can you draw circles in C?
what is recursion in C
Explain how can I open a file so that other programs can update it at the same time?
How can I copy just a portion of a string?
Explain the use of #pragma exit?
Explain what is the benefit of using an enum rather than a #define constant?
What is external variable in c?
What is the difference between void main and main in c?
Explain what is the difference between text files and binary files?
What is merge sort in c?