C Language - Strings

You Are Here :: Home > C Language > Strings - General Questions

 
1.

A string value or literal is enclosed in

A. brackets [ ] B. braces { }
C. single quotes ' ' D. double quotes " "




2.

Each character in memory takes up ___ bytes

A. 0 B. 1
C. 2 D. 4




3.

As far as can be determined, how many errors exist in the following segment of code?

char *x;
scanf("%c", &x);

A. 0 B. 1
C. 2 D. 3




4.

What would the following C code segment print out?

char *x = "Rhoda";
x = "hi";
printf("%s" , s);

A. hioda B. hi\0oda
C. hi D. Rhoda




5.

The conversion code %3s will stop reading chsr data when?

A. when white space is reached B. when 3 characters are read in
C. when a null is reached D. a and b




6.

The conversion code "%[^#@]s" would tell scanf

A. input only A, # and @ B. input up to a # or @ is reached
C. input only # and @ D. input up to a ^, #,or@ is reached




1

2

3

4

5

next »

 
 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on