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
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 |
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 |
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 |
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 |
Answer / ab
answer can be both a and d part..its compiler dependent...
Is This Answer Correct ? | 3 Yes | 0 No |
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() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
write a origram swaoing valu without 3rd variable
int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could anyone explain this to me.
2 Answers Bosch, eInfochips, HCL, IHCL,
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
what is variable length argument list?