Top

Library Functions

1.

Which of the following is the correct code?

Answer: A

No answer description available for this question.

Enter details here

2.

The prototypes of all standard library string functions are declared in the file string.h.

Answer: A

string.h is the header in the C standard library for the C programming language which contains macro definitions, constants, and declarations of functions and types used not only for string handling but also various memory handling functions.

Enter details here

3.

The macros defined under the header file limits.h are not defined under any other header file.

Answer: B

No answer description available for this question.

Enter details here

4.

Initial seed is ________ for the function srand(unsigned int seed).

Answer: B

void srand(unsigned int seed);
This function returns a new sequence of pseudo-random numbers using the specified seed.Initial seed is 1.

Enter details here

5.

Which of the given options is an array type used for holding information?

Answer: C

No answer description available for this question.

Enter details here

Answer: C

No answer description available for this question.

Enter details here

7.

What will be the output of the program?

#include
#include

int main()
{
    char *i = "55.555";
    int result1 = 10;
    float result2 = 11.111;
    result1 = result1+atoi(i);
    result2 = result2+atof(i);
    printf("%d, %f", result1, result2);
    return 0;
}

 

Answer: C

No answer description available for this question.

Enter details here

8.

ftell() returns the current position of the pointer in a file stream.

Answer: A

No answer description available for this question.

Enter details here

9.

Which of the following macros is not defined?

Answer: A

No answer description available for this question.

Enter details here

10.

What will be the output of the program?

#include

int main()
{
    int i;
    char c;
    for(i=1; i<=5; i++)
    {
        scanf("%c", &c); /* given input is 'b' */
        ungetc(c, stdout);
        printf("%c", c);
        ungetc(c, stdin);
    }
    return 0;
}

 

Answer: C

The ungetc() function pushes the character c back onto the named input stream, which must be open for reading.

This character will be returned on the next call to getc or fread for that stream.

One character can be pushed back in all situations.

A second call to ungetc without a call to getc will force the previous character to be forgotten.

Enter details here

Loading…
Tags: Library Functions Questions and Answers || Library Functions MCQ Questions and Answers || Library Functions GK Questions and Answers || Library Functions GK MCQ Questions || Library Functions Multiple Choice Questions and Answers || Library Functions GK || GK on Library Functions || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming