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


Please Help Members By Posting Answers For Below Questions

What is .obj file in c?

659


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

15534


Explain how can you restore a redirected standard stream?

598


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1459


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15065






What is an array? What the different types of arrays in c?

668


Differentiate between new and malloc(), delete and free() ?

686


What is the difference between array and pointer in c?

594


What are the 4 types of functions?

581


Is void a keyword in c?

589


What is difference between union and structure in c?

587


Why double pointer is used in c?

574


Can you please compare array with pointer?

625


How to find a missed value, if you want to store 100 values in a 99 sized array?

825


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

1791