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 |
which one is highest Priority in c? a)=,b)+,c)++,d)==
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
How to reverse a linked list
1 Answers Aricent, Fidelity, IBM, TCS,
What is difference between structure and union in c programming?
How are portions of a program disabled in demo versions?
Did c have any year 2000 problems?
i want to know the procedure of qualcomm for getting a job through offcampus
What will be the result of the following program? char*g() { static char x[1024]; return x; } main() { char*g1="First String"; strcpy(g(),g1); g1=g(); strcpy(g1,"Second String"); printf("Answer is:%s", g()); } (A) Answer is: First String (B) Answer is: Second String (C) Run time Error/Core Dump (D) None of these
What is the function of this pointer?
0 Answers Agilent, ZS Associates,
size maximum allocated by calloc()
design and implement a program that reads floating-points numbers in a sentinel-controlled loop until the user terminates the program by entering zero.your program should determinate and print the smallest,largest and average of the supplied numbers.