To find whether a number is even or odd without using any
conditional operator??
Answers were Sorted based on User's Feedback
Answer / kala
main()
{
int n;
printf("enter the number\n");
scanf("%d",&n);
if(n%2==0){
printf("number is even");}
else{
printf("number is odd");
}
}
or
if(n&1==0)
printf("even number");
else
printf(odd number");
| Is This Answer Correct ? | 31 Yes | 38 No |
Answer / sahithya
void main()
{
int n;
printf("enter n:");
scanf("%d",&n);
if(n%2==0)
printf( "even");
else
printf("odd");
}
| Is This Answer Correct ? | 15 Yes | 34 No |
Apart from dennis ritchie who the other person who contributed in design of c language.
What are the disadvantages of external storage class?
Give me the code of in-order recursive and non-recursive.
find out largest elemant of diagonalmatrix
What is the size of enum in bytes?
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
5 Answers Vector, Vector Solutions,
Explain the difference between ++u and u++?
Can a function argument have default value?
How do you define structure?
What is an array? What the different types of arrays in c?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is a global variable in c?