logo

Crowdly

Coding Café

Looking for Coding Café test answers and solutions? Browse our comprehensive collection of verified answers for Coding Café at dle.plaksha.edu.in.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

We hope you enjoyed taking this test. Please share your experience, if you wish to. 😊

View this question

Attempt either (A) or (B). Write down clearly in your answer which one you are attempting.

A.
In the following piece of code intended to receive user input character by character, and display it on the screen, the programmer did not pay attention to a subtle detail, due to which the program does not work as expected (even though it does not throw any compilation errors):

while (ch = getchar() != EOF)

  putchar(ch);

Can you help the programmer fix the bug by rewriting the code? Explain briefly.

(OR) 
B.

The following code segment written by a beginner in C does not work as expected. However, there is no compilation error. Can you spot the bug and rewrite the piece of code so it is bug-free? Explain briefly why the bug arose.

int

x = 5;

if (x = 0)

    printf("Zero\n");

else

    printf("Non-zero\n

");

View this question

Typing what on the keyboard signals

EOF (end of file) when a C program is taking data from the user?

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

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

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

View this question

The memory location where the last element of a five-element array is stored can be obtained by using &arr[5].

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.

View this question

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

0%
0%
0%
0%
View this question

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

Want instant access to all verified answers on dle.plaksha.edu.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!