Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

C Programming :: Basic Concepts

Home > C Programming > Basic Concepts > General Questions

41. What will be output of the following "c" code?

#include
void main() {
int i = 400, j = 300;
printf("%d %d ");
}

Answer: Option A

Explanation:

In the printf() function we are just printing values, but it's not specified what values are we actually printing. Therefore, in such a case, it is going to print garbage values.

Workspace


Tags:  No Tags on this question yet!

42.  What will be output of the following "c" code?

#include
void main()
{
printf("\n ab");
printf("\b si");
printf("\r ha");
}

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

43. What will be output of the following "c" code?

#include
void main ( )
{
printf(5+"Hello world");
}

Answer: Option C

Explanation:

It will print the characters starting from the 5th index(i.e, starting from the blank space) to the character present at (n-1)th index, or 10th index(i.e, ending at d).

Hence, the output will be  world.

Workspace


Tags:  No Tags on this question yet!

44. What will be output of the following "c" code?

#include
void main ( )
{
printf("\n Hello");
printf("\b world");
printf("\r Cup");
}

Answer: Option C

Explanation:

If line 4 gets executed alone, it will print Hello on the screen.

If line 4 and 5 gets executed, it will print Hell world on the screen, due to '\b'.

Now, when line 4, 5 and 6 gets executed, it will print Cupl world on the screen, due to '\r' the control goes to the starting point and re-writes Hel with Cup.

So, the correct answer will be Cupl world

Workspace


Tags:  No Tags on this question yet!

45. The following program fragment will give a
void main()
{
int sum, index,
-index= 50;
while (index > = 0) {
sum = sum / index;
-index;
} }

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

46. The following lines, if included in a program, will cause which of the following errors?

double c;
scanf("%c",c);

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

47. What would be the values assigned to a, b, c, if the statement scanf("%d %d %d", &a, &b, &c) is extended with input data item 123466 ?

Answer: Option A

Explanation:

Option C will be the correct option, but the input we are giving is 123466, so value of a= 123466 and not a=123456. Also, nothing will be assigned to b and c.

Workspace


Tags:  No Tags on this question yet!

48. What would be the value assigned to a,b and c if the statement scanf ("%3d,%3d,%3d", &a,&b,&c) is executed with input data as 1234_5678_9 (Note: _ denote as blank)

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

49. What will be the output of the following C program?

void main()
{
int i= 1234; j = 0177, k = 0xa08c;
printf ("%8d %80x /n", I,j,k),
}

Answer: Option A

Explanation:

The output will be an error, since variables 'j' and 'k' are not declared.

Workspace


Tags:  No Tags on this question yet!

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!



Most Popular Qs.

Latest MCQ Qs.