write a program for even numbers?
Answers were Sorted based on User's Feedback
Answer / sadakrishnaj
to print numbers which are even from 1 to 100
#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();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / maryam
q1 yes q2 yes q3 yes q4 no q5 no q6 yes q7 no q8 no q9 no q10 no
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sumon
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a%2==0)
{
printf("a is even number");
else
printf("a is odd number");
}
return o;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vinay kumar gupta
#include <stdio.h>
#include<conio.h>
void main()
{
int i,lim;
clrscr();
printf("enter the limit \n");
scanf("%d",&lim);
for(i=1;i<=lim;i++)
{
if (i%2==0)
}
printf("even no. are= %d",i);
getch();
}
Is This Answer Correct ? | 10 Yes | 11 No |
Answer / kamal
* read a number … */
#include <stdio.h>
int main (void) {
int num; /* input number */
int rem; /* remainder …*/
/* get number from user */
printf(“Please enter a number: ”);
scanf(“%d”, &num);
/* calculate remainder … */
rem = num % 2;
if (rem == 0) {
printf(“even\n”);
} else {
printf(“odd\n”);
}
/* terminate program */
return 0;
}
Is This Answer Correct ? | 4 Yes | 6 No |
Answer / shanmuganathanbalasubramanian
what is the difference between in if (i=2)$(i==2)
Is This Answer Correct ? | 3 Yes | 11 No |
Answer / gich
#include<stdio.h>
main()
{
int x;
for (x=10;x>=2;x-2;)
{
printf("x is %d\n"x);
{
}
Is This Answer Correct ? | 1 Yes | 12 No |
Answer / joe
#include<stdio.h>
//#include<conio.h>
main()
{
//clrscr();
int a;
printf("\nenter the no\n");
scanf("%d",&a);
evenNum(&a);
}
evenNum(int *i)
{
if(*i <0)
{
printf("\nEnter correct number :\n");
}
else if(*i%2==0)
{
printf("no is even");
}
else
{
printf("odd no");
}
getch();
main();
}
Is This Answer Correct ? | 6 Yes | 18 No |
How do you determine the length of a string value that was stored in a variable?
Tell me can the size of an array be declared at runtime?
What is the use of keyword VOLATILE in C?
what is printf
void main() { int a[]={1,2,3,4,5},i; for(i=0;i<5;i++) printf("%d",a++); getch(); }
Is it possible to run using programming C for Java Application?
What is the -> in c?
What is the code for 3 questions and answer check in VisualBasic.Net?
which is the best antivirus and how to update it
difference between native and cross compilers
what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void main() { int i,j=5; i=cube(j+3); printf("i=%d",i); }
Will Macros support multiple arguments ?