Saturday, 9 June 2018

Loop

Loop 

MCQ:
1. The following code ‘for(;;)’ represents an infinite loop. It can be terminated by.
A) break
B) exit(0)
C) abort()
D) All of the mentioned


True /False 


   1. The following block of code sums up an input series of grades (terminated by -1).

while( grade != -1 )
total = total + grade;
counter = counter + 1;
printf( "Enter grade, -1 to end: " );
scanf( "%d", &grade );

Question:
1. Why we use do-while loop in C? Also give any properties which you know.

No comments:

Post a Comment

ch-12 File Handling

Mcq 1. What does fp point to in the program?   #include<stdio.h> int main() {   FILE *fp;   fp=fopen("trial",...