EmbLogic's Blog

issue in assingment 02……

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.

2 Responses to issue in assingment 02……

  1. hemant.kumar says:

    while((ch=getchar())!=’0′)
    {
    if((int)ch%2==0)
    }
    try to do in this way..

    • sumit ahuja says:

      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..

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>