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 |
what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")
7 Answers Cadence, JNTU, Zen Technologies,
An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee
What is I ++ in c programming?
what is the program to display your name in any color?
What are the 4 data types?
Why we use break in c?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
I have seen function declarations that look like this
which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..}
how to use enum datatype?Please explain me?
what is the importance of spanning tree?
Find greatest number out of 10 number without using loop.