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 |
#include<stdio.h> int main() { int i=2; int j=++i + ++i + i++; printf("%d\n",i); printf("%d\n",j); }
how to add two numbers without using arithmetic operators?
Calculate 1*2*3*____*n using recursive function??
What is strcpy() function?
Is there a way to jump out of a function or functions?
Explain what are bus errors, memory faults, and core dumps?
15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?
what are bit fields? What is the use of bit fields in a structure declaration?
0 Answers Flextronics, TISL, Virtusa,
main() { printf(5+"Vidyarthi Computers"); }
WHAT IS ABSTRACT DATA TYPE
void main() { for(; 0 ;) ... { printf("hello"); ... } getch(); }
C program to read the integer and calculate sum and average using single dimensional array