Write a programme to find even numbers without using any
conditional statement?
Answers were Sorted based on User's Feedback
Answer / mathiyazhagan
#include<stdio.h>
main()
{
char res[2][5]={"Even","Odd"};
int n;
printf("Enter a number :");
scanf("%d",&n);
printf("the given no is = %s",res[n%2]);
}
| Is This Answer Correct ? | 51 Yes | 7 No |
Answer / sridhar
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,d; /*declaring variable using int*/
clrscr();
printf("enter the numbers:")
scanf("/n%d/n%d",&a,&b);/*getting number using scanf*/
c=a,b;
d=(c/2==0);
printf("the even number is:%d",d)/*print the final answer*/
getch();
}
| Is This Answer Correct ? | 8 Yes | 25 No |
Answer / guest
#nclude<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("\n Enter the numbers for a,b,c:");
scanf("%d%d",&a,&b);
c=a/b;
c=0;
printf("The given number is even");
getch();
}
| Is This Answer Correct ? | 6 Yes | 57 No |
why wipro wase
Why do we use int main?
What is scope and lifetime of a variable in c?
Can anyone tell what is stack overflow? what precaution we should take?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What is the difference between fread and fwrite function?
What are the uses of pre-processor directives?
What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }
8 Answers MindFire, TCS, Tech Mahindra,
How can you determine the maximum value that a numeric variable can hold?
what are the facialities provided by you after the selection of the student.
string reverse using recursion
write a programe returns the number of times the character appears in the string