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
Is fortran faster than c?
What is a structure member in c?
What is the symbol indicated the c-preprocessor?
What is structure in c language?
Explain data types & how many data types supported by c?
What is a structure in c language. how to initialise a structure in c?
What is a void pointer in c?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
Can you write the function prototype, definition and mention the other requirements.
How can I change their mode to binary?
What is the difference between int main and void main?
what will be the output for the following main() { printf("hi" "hello"); }
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
What is the difference between abs() and fabs() functions?
Tell me can the size of an array be declared at runtime?