what is the other ways to find a logic to print whether a
number is an even or odd wit out using % symbol??????? i
know three different ways to print it. so i need any other
different logic>>>>>
Answer Posted / govind279
#include<stdio.h>
main()
{
int x;
printf("Enter an ineteger ");
scanf("%d",&x);
if(x&0x1)
printf("Odd\n");
else
printf("Even\n");
}
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Can one function call another?
where are auto variables stored? What are the characteristics of an auto variable?
Differentiate between #include<...> and #include '...'
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Describe how arrays can be passed to a user defined function
What is #define used for in c?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
What are the different types of data structures in c?
Who invented b language?
What are pointers? What are different types of pointers?
What is floating point constants?
What is a file descriptor in c?
Can we change the value of constant variable in c?
What is pointer to pointer in c language?