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 |
Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass.
When is the “void” keyword used in a function?
What is the output of the program #include<stdio.h> #include<conio.h> void main() {0 int i,j=20; clrscr(); for(i=1;i<3;i++) { printf("%d,",i); continue; printf("%d",j); break; } getch(); }
where do we use volatile keyword?
What is the purpose of macro in C language?
Is array name a pointer?
how to swap 4 number without using temporary number?
What is an lvalue?
what would be the output of the follwing struct st { char name[20]; int i; float f; }; main() { struct st emp = {"forum"}; printf("%d %f",emp.i,emp.f); }
ASCII stands for
dynamically allocate memory for linear array of n integers,store some elements in it and find some of them
wat is the output #define VOLEDEMORT _who_must_not_be_named int main() { printf("VOLEDEMORT"); }