C Programming :: Input / Output

Home > C Programming > Input / Output > General Questions

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

Answer: Option D

Explanation:

In line 3, we are declaring a character array 'line' of exactly 80 bytes. In the next line, 'gets' is used to read a line of text from standard input device(stdin), and in the next line 'puts' is used to print the string or line of text. So the coreect option is D.   

Workspace


Tags:  No Tags on this question yet!

4 / 6

 if i,j,k are integers, the scanf function to enter i,j,k such that i is decimal,j is octal and k is hexadecimal would be

Answer: Option C

Explanation:

Following are the format specifiers for the above cases-

1. %d- to scan an integer value.

2. %o- to scan an octal value.

3. %x- to scan value in hexadecimal format.

 

Workspace


Tags:  No Tags on this question yet!

5 / 6

 What would be the output of the following C program if input to the program is 'e'?

void main ()
{
char lower, upper;
lower = getchar();
upper= toupper (lower);
putchar (upper);
}

Answer: Option C

Explanation:

As lower=getchar(), and the input is 'e', so lower will contain 'e'. In the next line 'e' will get converted to its upper case i.e, upper will contain 'E'. In the next line 'E' will get printed, so the correct option is option C.

Workspace


Tags:  No Tags on this question yet!

6 / 6

 float x, y, z;
scanf ("%f %f", &x, &y);

If input stream contains "4.2 3 2.3 ..."
What will x and y contain after scanf?

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!