Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}

Answers were Sorted based on User's Feedback



main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }..

Answer / karen

It is theoretically possible for the answer to vary
depending on characteristics of the system. This is why it
is always best to use sizeof instead of assuming the size
of a datatype. This line is equivalent to:

printf("\n %d %d %d",sizeof(char),sizeof(char[2]),sizeof
(int));

The middle is char[2] because it contains 3 and \0.

On my x86 windows 7 system, this program outputs 1 2 4.
Your numbers may be different due to system architecture
differences.

Is This Answer Correct ?    12 Yes 2 No

main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }..

Answer / manjulatha

'3' is a character so it take 1 byte
"3" is a string containing 2 characters 3 and \0 so it takes
2bytes
3 is a integer and it takes 4 bytes
so answer is 1 2 4

Is This Answer Correct ?    15 Yes 6 No

main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }..

Answer / manish soni bca 3rd year jaipu

#include<stdio.h>
#include<conio.h>
void main()
{
printf("%d %d %d",sizeof('3'),sizeof("3"),sizeof
(3));
getch();
}


answer is:-
1 2 2
on Turbo C++ 4.5 on win base at win 7

Is This Answer Correct ?    10 Yes 2 No

main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }..

Answer / hemachandar

the first ('3') value goes to char., so it takes 1.
then for second ("3") value takes the string., string value takes 2.
for third (3), its int., so it takes the value of 2.

Every printf takes the values from right to left, so it takes the output as 2 2 1.
Simple!!!

Is This Answer Correct ?    1 Yes 1 No

main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }..

Answer / molugu.ashwin

out put 4 2 4

Is This Answer Correct ?    16 Yes 17 No

main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); }..

Answer / shiva

2 2 2

Is This Answer Correct ?    12 Yes 15 No

Post New Answer

More C Interview Questions

How to print %d in output

6 Answers   Wipro,


How to find the given no is odd or even without checking of any condition and loops. (Hint: Using array)

4 Answers  


what is the return value (status code) of exit() function.... what the arguments(integer value) passed to it means....

1 Answers   TCS,


Apart from dennis ritchie who the other person who contributed in design of c language.

0 Answers  


What is table lookup in c?

0 Answers  


3. When do you say that a digraph is acyclic A)if and only if its first search does not have back arcs B)a digraph is acyclic if and only if its first search does not have back vertices C)if and only if its first search does not have same dfnumber D)None of these

0 Answers   Accenture,


Are the variables argc and argv are local to main?

0 Answers   TISL,


Write a c program for sum of first n terms of the series S = 1 - (1/3) + (1/5) -(1/7) + (1/9) ......

2 Answers  


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

0 Answers  


Why do we need a structure?

0 Answers  


write a reverse string to print a stars.(with out using logic) ***** **** *** ** *

2 Answers  


What is infinite loop?

0 Answers  


Categories