q15-WAP that reads integers until 0 is entered.after i/p terminates,the program should report the total no of even integers (excluding the 0) entered,the avg value of even integers………………………..how we read the i/p until 0…plz comment.
q15-WAP that reads integers until 0 is entered.after i/p terminates,the program should report the total no of even integers (excluding the 0) entered,the avg value of even integers………………………..how we read the i/p until 0…plz comment.
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
while((ch=getchar())!=’0′)
{
if((int)ch%2==0)
}
try to do in this way..
int a;
printf(“enter an integer(0 to stop): “);
while(a!=0)
{
scanf(“%d”,&i);
{
rest of ur code here..
}
}
it wont exit till 0 is entered..