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 |
#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }
Write a program to print ASCII code for a given digit.
how to find out the inorder successor of a node in a tree??
in linking some of os executables are linking name some of them
5. What kind of sorting is this: SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort
Can you define which header file to include at compile time?
What is an volatile variable?
How can I remove the leading spaces from a string?
What is extern storage class in c?
What is structure in c explain with example?
what is difference between declaring the pointer as int and char in c language?
Is c call by value?