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 of the following operators is incorrect and why? ( >=, <=, <>, ==)
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
How can I make sure that my program is the only one accessing a file?
what is mallloc()?how it works?
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What is the difference between far and near ?
What will be your course of action for a push operation?
What are bitwise shift operators in c programming?
What are the back slash character constants or escape sequence charactersavailable in c?
how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.
Is Exception handling possible in c language?