logo

Crowdly

Browser

Add to Chrome

Questions Bank (1555208 total)

Consider the piece of code:

for (i = 1, sum = 0; i <= 5; i++) 

sum += i * i;

Which of the following statements is true?

0%
0%
0%
0%
0%
View this question

How many times would the do...while loop (lines 6-9) run when the program is run successfully?

0%
0%
0%
0%
View this question
We have to use a loop when taking user input into an array of 10 integers, even though we do not have to declare each of the elements of the array separately.

0%
0%
View this question

A line such as #define MAX 4 that appears in a C program is:

0%
0%
0%
0%
View this question
Within a sentence, state what the above program does.

View this question
Select all correct statements concerning arrays in C:

0%
0%
0%
0%
0%
View this question
How many times does the for loop run in this specific program?

View this question
In class, we discussed several ways of writing an improved version of the program for CGPA calculation. Mention any one way that would greatly minimise any data input inconsistencies from the user end, and would make the program generic enough to calculate the CGPA of any university.
View this question

The user-defined function used by the program takes a float number as an argument and returns nothing.

0%
0%
View this question
As you know, control goes into the while loop, if the expression evaluates to be true. Any non-zero value maps to a true in C. Given these, which of the following options is equivalent to the statement:

while (numb != 0) { }

0%
0%
0%
0%
0%
View this question