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

10 Questions | Attempts: 64
Share
SettingsSettings
Please wait...
  • 1/10 Questions

    The ___ used in printf( ) is a format specification for printing out a string

    • %s
    • %d
    • %c
    • %f
Please wait...
Quiz 7 (Improvement) And Assignment 4 - Bee-2a - Quiz
About This Quiz

Strings, Strings Pointers


Quiz Preview

  • 2. 

    Strings in C are char array..

    • True

    • False

    Correct Answer
    A. True
  • 3. 

    We can store both int and char data in a char two-dimensional array?

    • True

    • False

    Correct Answer
    A. False
  • 4. 

     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

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

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

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

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

    Correct Answer
    A. Str[0][0], atoi(str[0][1]
  • 5. 

    Gets() function is used to _____

    • Get any kind of data from user

    • Get string from user

    • Do job exactly like scanf() function

    Correct Answer
    A. Get string from user
  • 6. 

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

    • A quick brown fox jumped over a lazy dog

    • Error

    • A quick br

    Correct Answer
    A. Error
  • 7. 

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

    • True

    • False

    Correct Answer
    A. False
  • 8. 

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

    • 10

    • 9

    • Until the condition is true

    Correct Answer
    A. 10
  • 9. 

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

    • Hello Bee2A

    • Bye Bee2A

    • Error

    Correct Answer
    A. Bye Bee2A
  • 10. 

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

    • %s

    • %c

    • %d

    Correct Answer
    A. %d

Quiz Review Timeline (Updated): Mar 20, 2022 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 10, 2014
    Quiz Created by
    Aamirakbar2
Back to Top Back to top
Advertisement