main()

{

printf("%d, %d", sizeof('c'), sizeof(100));

}

a. 2, 2

b. 2, 100

c. 4, 100

d. 4, 4

Answers were Sorted based on User's Feedback



main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / guest

a) 2, 2

Is This Answer Correct ?    48 Yes 22 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / lalitha

size of char is 1
and size of int is 2/4 depending on n-bit m/c

Is This Answer Correct ?    24 Yes 6 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / lalitha

@ guest

if we give sizeof(char) or
char ch;
sizeof(ch) the result is 1

and if we give sizeof('1)
sizeof('c') the result is 2/4

does it treat as AsCII value which is an interger?????

how come????

Is This Answer Correct ?    12 Yes 1 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / anil

for the above question the give options are not suitable

it gives the out put as:
1, 2

Is This Answer Correct ?    9 Yes 6 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / praneeth

In C programming language
The size of character literal is size of int. (2 or 4)
ex:: sizeof('A') == sizeof(65)

the size of char is 1
ex:: char ch = 'a';
sizeof(ch) == 1

I hope U understand....
praneeth

Is This Answer Correct ?    7 Yes 4 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / ab

answer can be both a and d part..its compiler dependent...

Is This Answer Correct ?    3 Yes 0 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / sai

Answer will be (2,2).
EXPLANATION:
In the above printf() statement the size of the char is 2 because
it will takes ASCII value for 'c' because "%d" is the integer specifier.

Is This Answer Correct ?    3 Yes 0 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / ameesha

d). 4,4

Is This Answer Correct ?    3 Yes 0 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / balu

answer 2,2
char=1byte
int =2bytes

Is This Answer Correct ?    2 Yes 1 No

main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 ..

Answer / vamsi

A.(2,2)

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Code Interview Questions

to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD

6 Answers   Synergy,


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4

2 Answers   HCL,


main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }

1 Answers   Zoho,


Write a function to find the depth of a binary tree.

13 Answers   Adobe, Amazon, EFI, Imagination Technologies,


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  






#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }

1 Answers  


programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h

1 Answers  


hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?

6 Answers  


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

0 Answers  


There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.

1 Answers   TCS,


print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


Write a program that reads a dynamic array of 40 integers and displays only even integers

2 Answers  


Categories