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
What is .obj file in c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Explain how can you restore a redirected standard stream?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What is an array? What the different types of arrays in c?
Differentiate between new and malloc(), delete and free() ?
What is the difference between array and pointer in c?
What are the 4 types of functions?
Is void a keyword in c?
What is difference between union and structure in c?
Why double pointer is used in c?
Can you please compare array with pointer?
How to find a missed value, if you want to store 100 values in a 99 sized array?
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.