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));
}
wat is the o/p and how?

Answer Posted / ashwin

4 2 4

sizeof('3') means it will take ascii value which is an
integer, it shows size of integer.

sizeof("3") means, here it will treat it as an array, it
will print size of an array, so array contain '3' and '\0'
so out put is 2.

try size("3ashwin") it will give 8 as out put.

sizeof(3) means directly we asking size of an integer.

thank you

if is an wrong answer plz write correct answer to

molugu.ashwin@gamil.com

Is This Answer Correct ?    71 Yes 17 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is wrong with this program statement? void = 10;

1316


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

1185


What is a good way to implement complex numbers in c?

1093


List some basic data types in c?

1084


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1141


What is the scope of static variable in c?

1085


Discuss the function of conditional operator, size of operator and comma operator with examples.

1216


What is the general form of function in c?

1073


What is FIFO?

1843


Which is more efficient, a switch statement or an if else chain?

1084


What the different types of arrays in c?

1128


What is the return type of sizeof?

1117


What is call by reference in functions?

1545


Explain what is the benefit of using enum to declare a constant?

1137


How would you obtain the current time and difference between two times?

1342