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 / tirtharaj dash@nist
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b,r,i;
scanf("%d",&b);
int temp=b;
for(i=1;i<=b/2;i++)
{
r=temp-2*i;
}
if(r==0)
printf("\neven...");
else
printf("\nodd");
getch();
return 0;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is the height of tree if leaf node is at level 3. please explain
What is #ifdef ? What is its application?
Explain the properties of union. What is the size of a union variable
Is boolean a datatype in c?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
Can you write the function prototype, definition and mention the other requirements.
Which node is more powerful and can handle local information processing or graphics processing?
Explain what is the advantage of a random access file?
Why doesnt long int work?
What is the difference between text and binary i/o?
How can you check to see whether a symbol is defined?
The difference between printf and fprintf is ?
What is default value of global variable in c?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
What is page thrashing?