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
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is %lu in c?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What are local variables c?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
Is javascript written in c?
Explain pointers in c programming?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
What is the difference between strcpy() and memcpy() function in c programming?
When should a type cast not be used?
How are pointers declared in c?
Explain the properties of union.
What is the difference between abs() and fabs() functions?