Write a programme to find even numbers without using any
conditional statement?

Answers were Sorted based on User's Feedback



Write a programme to find even numbers without using any conditional statement?..

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

Write a programme to find even numbers without using any conditional statement?..

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

Write a programme to find even numbers without using any conditional statement?..

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

Post New Answer

More C Interview Questions

What is the significance of c program algorithms?

0 Answers  


What math functions are available for integers? For floating point?

0 Answers  


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

0 Answers  


Write a C program to fill a rectangle using window scrolling

1 Answers  


#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }

7 Answers   HCL,






program to find the magic square

1 Answers   Infosys,


How many types of operator or there in c?

0 Answers  


How many bytes are occupied by near, far and huge pointers (dos)?

0 Answers  


Tell me what is null pointer in c?

0 Answers  


What are unions in c?

0 Answers  


Simplify the program segment if X = B then C &#8592; true else C &#8592; false

0 Answers  


What are c header files?

0 Answers  


Categories