[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Basic Concepts - Discussion

Home > C Programming > Basic Concepts > MCQs Questions Discussion

22 / 90

What is the output of the following 'C' program ?

#include<stdio.h>
void main()
{
char ch = 'A';
printf ("%d%d",sizeof(ch),sizeof('A'));
}

A1 1

B2 2

C1 4

D2 1

Answer: Option (Login/Signup)

Show Explanation

The size of char is 1 byte, hence sizeof(ch) is equal to 1.

Whereas, 'A' is a character constant, which is seen as an int. We know the size of int is 4 bytes hence, sizeof('A') is equal to 4.

Therefore, the output is 1 4.

Asked In ::

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here