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
i have a written test for microland please give me test pattern
Is calloc better than malloc?
What is difference between union All statement and Union?
What is the difference between break and continue?
How can a program be made to print the name of a source file where an error occurs?
Why is #define used?
What is the difference between class and object in c?
What is a newline escape sequence?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What is a macro, and explain how do you use it?
Write a factorial program using C.
What are the storage classes in C?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
What is pointer to pointer in c with example?
How can you check to see whether a symbol is defined?