Quiz 7 (Improvement) And Assignment 4 - Bee-2a *

10 Questions | Attempts: 56
Share

SettingsSettingsSettings
Programming Quizzes & Trivia

Strings, Strings Pointers


Questions and Answers
  • 1. 
    Char str[10] = "A quick brown fox jumped over a lazy dog";puts(str);what will print?
    • A. 

      A quick brown fox jumped over a lazy dog

    • B. 

      Error

    • C. 

      A quick br

  • 2. 
    Char str1[10] "Hello!";int count1 = 0;    while(str1[count1] != '\0')        count1++;while loops will iterate until ______
    • A. 

      10

    • B. 

      9

    • C. 

      Until the condition is true

  • 3. 
    Gets() function is used to _____
    • A. 

      Get any kind of data from user

    • B. 

      Get string from user

    • C. 

      Do job exactly like scanf() function

  • 4. 
    Strings in C are char array..
    • A. 

      True

    • B. 

      False

  • 5. 
    Char str[20] = "hello bee2a";printf("%s", str);Output = hello bee2a
    • A. 

      True

    • B. 

      False

  • 6. 
    The ___ used in printf( ) is a format specification for printing out a string
    • A. 

      %s

    • B. 

      %d

    • C. 

      %c

    • D. 

      %f

  • 7. 
     char *str[] = {"Hello Bee2A"}; *str = "Bye Bee2A"; puts(*str);Output = __________
    • A. 

      Hello Bee2A

    • B. 

      Bye Bee2A

    • C. 

      Error

  • 8. 
     char *str[] = {"2014"}; int year = atoi(str[0]); printf("___", year);What should be the format specifier?
    • A. 

      %s

    • B. 

      %c

    • C. 

      %d

  • 9. 
     char *str[1][2] = {"June", "6"}; printf("Month name is %s, which is %dth month of the year", ___ , ___ );What should be in the blanks to give the following outputMonth name is June, which is 6th month of the year
    • A. 

      Str[0][0], atoi(str[0][1]

    • B. 

      Str[0][1], atoi(str[1][0]

    • C. 

      Str[0][0], atoi(str[0][0]

    • D. 

      Str[1][1], atoi(str[1][1]

  • 10. 
    We can store both int and char data in a char two-dimensional array?
    • A. 

      True

    • B. 

      False

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.