write a program for even numbers?
Answers were Sorted based on User's Feedback
Answer / v.karthikeyan
#include <stdio.h>
main()
{
int num;
printf("Enter a number to know the entered number is odd or
even \n");
scanf("%d",&num);
if (num%2==0)
{
printf(" The number is Even");
else
printf(" The number is Odd")
}
getch();
}
Is This Answer Correct ? | 88 Yes | 15 No |
Answer / dwarika
#include<stdio.h>
#include<conio.h>
int main()
{
clrscr();
int a;
printf("enter the no");
scanf("%d",&a);
if(a%2==0)
{
printf("no is even");
}
else
{
printf("odd no");
}
getch();
return 0;
}
Is This Answer Correct ? | 56 Yes | 6 No |
Answer / sameer.chaudhari
main()
{
int num;
printf("Plz enter the number :=> ");
scanf("%d",&num);
if (!(num & 1))
printf("Even");
getch();
}
Is This Answer Correct ? | 41 Yes | 33 No |
Answer / nirdesh pal
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
printf("enter the number");
scanf("%d",&i);
if(i%2==0)
{
printf("number is even");
else
printf("number is odd");
}
getch();
}
Is This Answer Correct ? | 3 Yes | 1 No |
#include<stdio.h>
#include<conio.h>
main()
{
int a;
printf("Please enter the number :=> ");
scanf("%d",&a);
if (a%2==0)
printf("Even");
else
printf("odd");
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mehak saini
include<stdio.h>
include<conio.h>
void main()
{
inti,num;
printf("enter the number")
scanf(%d",&num);
for(i=1;i=<num;i+1)
{
if(i%2==0)
{
printf("%d",i);
}
}
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / joe
#include<stdio.h>
//#include<conio.h>
int main()
{
//clrscr();
int *a;
printf("\nenter the no\n");
scanf("%d",&a);
if(*a <0)
{
printf("\nEnter correct number :\n");
}
else if(*a%2==0)
{
printf("no is even");
}
else
{
printf("odd no");
}
getch();
main();
}
Is This Answer Correct ? | 15 Yes | 15 No |
main() { int i = -3,j=2,k=0,m; m= ++i || ++j && ++k; printf("%d%d%d",i,j,k,m); }
WHO WROTE C LANGUAGE?
What are different types of pointers?
write a program to swap bits in a character and return the value prototype of function char fun (char a, charb flag c) where fun returns a char, char a is a the value char b is the bit to be changed and flag c is the bit value for eg: x=fun(45,7,0) since 45 is 0010 0101 and ow x should contain the value 65 (0110 0101)
1 Answers Bosch, College School Exams Tests,
What are header files in c programming?
What is Your Name :)
How can I get the current date or time of day in a c program?
value = 0xabcd; for (loop = 1; (value >> 1) & 1 | loop & 1; loop++) { foo(); if (loop & 1) value >>= 1; } how many times is foo() executed?
Diff between for loop and while loop?
What are loops c?
When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?
why do we use # in c-language?