Thursday, 9 November 2017

Strings Questions In C

---------------------------------------------------------------------------------------------------------
Previous Page                 Home               Last Page
---------------------------------------------------------------------------------------------------------

6.
What will be the output of the program ?

#include
#include

int main()
{
    char str1[20] = "Hello", str2[20] = " World";
    printf("%s\n", strcpy(str2, strcat(str1, str2)));
    return 0;
}

A.  Hello
B.  World
C.  Hello World
D.  WorldHello

Answer: C
---------------------------------------------------------------------------------------------------------

7.
What will be the output of the program ?

#include

int main()
{
    printf(5+"Good Morning\n");
    return 0;
}

A. Good Morning
B. Good
C. M
D. Morning

Answer: D
--------------------------------------------------------------------------------------------------------

8.
Which standard library function will you use to find the last occurance of a character in a string in C?

A. strnchar()
B. strchar()
C. strrchar()
D. strrchr()

Answer: D
---------------------------------------------------------------------------------------------------------

9.
What do the following declaration signify? 

char **argv;

A. argv is a pointer to pointer.
B. argv is a pointer to a char pointer.
C. argv is a function pointer.
D. argv is a member of function pointer.

Answer: B
--------------------------------------------------------------------------------------------------------

10.
Which directory the compiler first looks for the file when using #include?

A. Current directory where program is saved
B. C:COMPILERINCLUDE
C. S:SOURCEHEADERS
D. Both (b) and (c) simultaneously

Answer: B
-------------------------------------------------------------------------------------------------------
Previous Page           Home                  Next Page
-------------------------------------------------------------------------------------------------------

More Imp Topics:

Array
Preprocessor
Structures
Control Structures
Switch Case
Printf
Variables
File Handling



100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...