TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ian Malven
NA
2
8.6k
I have bugs in my program but am failing to find them help please
Oct 25 2012 8:42 AM
I have a code with me that i would like to use ,what this code should do is that it reads the amount of data to be input and it counts the number of even and odd numbers from input data here is the code :
#include<stdio.h>
void main( )
{
int x,count,countEven,countOdd,num;
printf("Enter number of data\n");
scanf("%d",&count);
while(x<count)
{
printf("Enter positive interger:\n");
scanf("%d",&num);
if(num%2==0)
countEven++;
else
x++;
}
countOdd++;
printf("Number of even intergers is %d\n",countEven);
printf("Number of odd intergers is %d\n",countOdd);
}
//countOdd represents the number of odd intergers
//countEven represents the number of even intergers
//count represents the amount of data to be input
//x represents number of digits entered
PLEASE HELP ME FIND WHERE THIS CODE IS GOING WRONG
Reply
Answers (
3
)
A C Language Programmin Question Using The While Loop
how can I insert data in DB by interface