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
What is an lvalue in c?
What are different types of operators?
Explain how does flowchart help in writing a program?
to find the closest pair
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is the description for syntax errors?
Can include files be nested? How many levels deep can include files be nested?
What is stack in c?
How to implement a packet in C
What is difference between static and global variable in c?
What is 'bus error'?
Explain how can you be sure that a program follows the ansi c standard?
Do you know what are the properties of union in c?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
What are types of functions?