Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?
Answers were Sorted based on User's Feedback
Answer / nipun
#include<stdio.h>
#include<conio.h>
void main()
{
int var;
int count=0;
int n=0;
clrscr();
while(n<10)
{
printf("Enter the number:");
scanf("%d",&var);
if(var%2 == 0)
{
count++;
n++;
}
else
{
n++;
continue;
}
}
printf("Even numbers present:%d",count);
getch();
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / sansiri
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i=0;
int count=0;
printf("\n Enter the 10 integer numbers");
while(i<10)
{
scanf("%d",&n);
if(n%2==0)
{
count++;
}
i++;
}
printf("\nCount of even numbers:%d",count);
getch();
}
printf
| Is This Answer Correct ? | 4 Yes | 1 No |
what is meant by linking error? how can i solve it? if there is a linking error " unable to open file 'cos.obj'? then what should i do?
when i use cout or cin call & then either << or >> .....it shows declaration syntax error...what should i do? cout<<"anything"; int a; cin>>a; return 0;
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
How to convert hexadecimal to binary using c language..
1 Answers Bajaj, GAIL, Satyam, Zenqa,
class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }
main() { char c; for(c='A';c<='Z';c++) getch(); }
char* f() return "hello:"; void main() {char *str=f(); }
Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?
WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION void main() { int x=4,y=3,z; z=x-- -y; printf("%d%d%d",x,y,z); }
Answering Yes or No in C++...using only stdio.h and conio.h..........help me please...? here's must be the output of the program: Screen A Exam No. items Score 1 20 20 2 35 35 Another Entry? [Y] or [N] : Screen B: Record No. Student's Name: 1 Fernando Torres 2 Chuck Norris Note: if you press Y, the program must repeat the procedure in screen A, then if N, the program must proceed to the screen B....Please Help me out............
what is run time error?
I can not get my C++ program to work right. It is supposed to tell if a word is a palindrome or not, but it only tells thet the word is not a palindrome. And I can't fix it.