Top

C Constants

41.

What is the correct way to round offx, a float, to an int value?

Answer: A

No answer description available for this question.
 

Enter details here

42.

What is the output of this C code?

int main()
{
printf("C programming %s", "Class by\n%s AllIndiaExams", "SUPER");
}

 

Answer: C

This program has only one %s within first double quotes, so it does not read the string “SUPER”.
The %s along with the AllIndiaExams is not read as a format modifier while new line character prints the new line.

Enter details here

43.

As soon as a pointer variable is freed, its value 

Answer: D

No answer description available for this question.
 

Enter details here

Answer: D

No answer description available for this question.

Enter details here

45.

Which of the following comments regarding the reading of a string, using scanf(with optional) and get is true?

Answer: C

No answer description available for this question.
 

Enter details here

46.

For the following code snippet:

char *str = “Sanfoundry.com\0” “training classes”;
The character pointer str holds reference to string:

Answer: B

’\0′ is accepted as a char in the string. Even though strlen will give length of string “Sanfoundry.com”, in memory str is pointing to entire string including training classes”

Enter details here

Answer: D

No answer description available for this question.
 

Enter details here

Answer: D

No answer description available for this question.
 

Enter details here

49.

What is the output of this C code?

#include 
    int main()
    {
        printf("sanfoundry\rclass\n");
        return 0;
    }

 

Answer: C

No answer description available for this question.
 

Enter details here

50.

The program fragment
int i = 263 ;
putchar (i) ;
prints

Answer: C

263 in binary form is 100000111. If one tries to print an integer as a character, only the last 8 bits will be considered - the rest chopped off. So, in this case the ASCII value of 00000111 will be printed

Enter details here

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