C Programming :: Basic Concepts

Home > C Programming > Basic Concepts > General Questions

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

71 / 87

 A c source code file can be

Acompiled only

Binterpreted only

Cboth compiled and interpreted

Dnothing

Answer: Option A

Explanation:

A source code is the input to the compiler. After the code has been compiled, we get the compiled code, which is basically not in a readable format. It can be just read by the machine. It is the work of the interpreter to execute this compiled code while execution of the program.

Hence, the correct option is A.

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

72 / 87

 Recursive Descent parser is a type of

ABottom up parser

BTop Down parser

CNone of these

DBottom down parser

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

73 / 87

 what is big-endian

AMSB at lower address LSB at higher address

BLSB at lower address MSB at higher address

Cmemory mgmt technique

Dnone of the above

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

74 / 87

 #include
main()
{
scanf("%d");
printf();
}
which of the following is correct?

Acompilation error

BRun time error

CNo output

Ddepends on the compiler

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option A

Explanation:

It will result to compilation error.

The return type of main() is not mentioned. Also, in the scanf() function, for the format specifier %d, there is no matching int argument. Moreover, printf() contains no argument.

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

75 / 87

 What is the output of the following 'C' program ?

#include
int main()
{
200;
printf("tricky problem");
}

Awarning message

Bcompilation error

Crun time error

Dnone of these

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option A

Explanation:

Here the number 200 has no importance, you can neglect it or remove it or just leave it just like that, code will compile and run just fine, giving the output as tricky problem.

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

76 / 87

 what is the correct prototype of printf function ?

Aprintf(char *p,...);

Bprintf(const *char *p,...);

Cprintf(const char *p,...);

Dprintf(const *char p,...);

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

77 / 87

 What is the output of the following 'C' program ?

#include
int main()
{
printf( printf ("world") );

}

Aprints world

Bprints printf ("world")

Cprints nothing

Dcompiler error

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

78 / 87

 What does main return on successful execution?

A1

B0

C-1

DNonzero

 View Answer |  Discuss in Forum |  Workspace | Asked In Global Edge |

Answer: Option B

Explanation:

The return type of the main() function basically tells about its exit status. As a convention, the exit status of 0 tells the compiler that it's a success and other non-zero values tell that it's a failure. More precisely, return 0 tells the compiler that the end of code was reached and the program was executed successfully. 

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

79 / 87

 What will be output of the following "C" code?

#include
void main()
{
printf("%d ",printf("FACE"));
}

AFACE4

BError

CGarbage Value

DFACE

Answer: Option A

Explanation:

printf("FACE");........will be executed first and will return the output as FACE.

Now, since no. of characters in the word FACE is 4, and we know that printf() return the no of characters that are passed as an argument.

Therefore, the output of this code will be FACE4.

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

80 / 87

 What will be output of the following "C" code?

#include
void main()
{
printf("\nks");
printf("\bmi a");
printf("\rha n");
}

Aksmiha

Bmis

Cha na

Dhamiks

Answer: Option C

Explanation:

Line 4 will give the result as "ks".

Line 5 will give the result as "kmi a". The escape sequence '\b'(backspace) re-writes "ks" with "kmi a".

Line 6 will give the result as "ha na". The escape sequence '\r'(carriage return) returns the control to the starting point of the string and it will rewrite "kmi a" with "ha na".

Hence, the output is ha na.

Workspace