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 |
printf("%d",(printf("Hello")); What it returns?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Which are low level languages?
Is it possible to execute code even after the program exits the main() function?
int main() { int i=1; switch(i) { case '1': printf("hello"); break; case 1: printf("Hi"); break; case 49: printf("Good Morning"); break; } return 0; }
what is dangling pointer?
How can you check to see whether a symbol is defined?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
What is the use of pragma in embedded c?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
How is a two dimensional array passed to function when the order of matrix is not known at complie time?
what is difference between ANSI structure and C99 Structure?