To find whether a number is even or odd without using any
conditional operator??
Answer Posted / rudrakshala leela phani kumar
int main()
{
int a[2][5]={"Even","Odd"};
int n;
printf("Enter Integet No:");
scanf("%d",&n);
printf("\nResult:%d",a[n%2]);
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Explain what is output redirection?
What is a dynamic array in c?
writ a program to compare using strcmp VIVA and viva with its output.
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
What is calloc in c?
Why c is known as a mother language?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
What is the Purpose of 'extern' keyword in a function declaration?
what do u mean by Direct access files? then can u explain about Direct Access Files?
How many bytes are occupied by near, far and huge pointers (dos)?
What is a static function in c?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
What is the difference between constant pointer and constant variable?
Is c still relevant?