write a program for even numbers?

Answers were Sorted based on User's Feedback



write a program for even numbers?..

Answer / vin

yes

Is This Answer Correct ?    0 Yes 0 No

write a program for even numbers?..

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

write a program for even numbers?..

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

write a program for even numbers?..

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

write a program for even numbers?..

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

write a program for even numbers?..

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

write a program for even numbers?..

Answer / shanmuganathanbalasubramanian

what is the difference between in if (i=2)$(i==2)

Is This Answer Correct ?    3 Yes 11 No

write a program for even numbers?..

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

write a program for even numbers?..

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

Post New Answer

More C Interview Questions

What does s c mean on snapchat?

0 Answers  


Write a pro-gramme to determine whether the number is even or odd?

1 Answers  


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

3 Answers   Infosys,


12344321 123 321 12 21 1 1 how i print this program??

5 Answers   DSR Management, Winit,


What are the applications of c language?

0 Answers  






Hi Every one...........I have been selected for the SBI Clerk. But i m one month Pregnanat. So anyone please suggest me, is they take any objection on my joining .

4 Answers   State Bank Of India SBI,


Explain what is output redirection?

0 Answers  


wat is the difference between array and pointer?

4 Answers   Wipro,


Is this program statement valid? INT = 10.50;

0 Answers  


What is an identifier?

0 Answers  


What is an arrays?

0 Answers  


write a program that will read the temperature in Celsius and convert that into Fahrenheit.

1 Answers  


Categories