To find whether a number is even or odd without using any
conditional operator??
Answer Posted / 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 |
Post New Answer View All Answers
What is the use of volatile?
Is python a c language?
What are control structures? What are the different types?
What is a function simple definition?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
What is the difference between far and near in c?
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.
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
How can you pass an array to a function by value?
Explain what happens if you free a pointer twice?
What is the code in while loop that returns the output of given code?
What is pre-emptive data structure and explain it with example?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
How to define structures? ·