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 / amit kumar samal
#include<stdio.h>
#include<conio.h>
void main()
{
int newno;
printf("Enter your number: ");
scanf("%d",&newno);
int result=newno/10;
int reminder=newno-result*10;
int value=reminder/2;
if(value==0)
{
printf("%d is an Even number",newno);
}
else
printf("%d is an Odd number",newno);
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain how can I remove the trailing spaces from a string?
What is the argument of a function in c?
how can I convert a string to a number?
How do you use a 'Local Block'?
Can a pointer be static?
What is unsigned int in c?
How can I sort a linked list?
What is a union?
What is an expression?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
Multiply an Integer Number by 2 Without Using Multiplication Operator
What is the maximum no. of arguments that can be given in a command line in C.?
How do you write a program which produces its own source code as output?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
How to draw the flowchart for structure programs?