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...

what is the output of the program??

#include<stdio.h>

main ( )

{

int a=010,sum=0,tracker:

for(tracker=0;tracker<=a;tracker++)

sum+=tracker;

printf(ā€œ %d\nā€,sum);

}

what is the difference between a=10 and a=010??

Answer Posted / vidyullatha

In linux:
Answer is 36 instead of 55.
i.e the loop iterates till tracker=8 instead of tracker=10.
Thats is because, I guess when u initialise a=010, compiler
takes a = octal 10 i.e in decimal it is 8.
So the loop iterates through tracker<=8.
This is my guess. I am not sure of the real answer.
Please let me know if any one knows the right answer.

Is This Answer Correct ?    12 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can include files be nested? How many levels deep can include files be nested?

1088


Define recursion in c.

1200


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

2030


What is #define size in c?

1118


What are the different types of errors?

1071


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1802


What's a good way to check for "close enough" floating-point equality?

1095


How can I get the current date or time of day in a c program?

1166


How many types of functions are there in c?

1064


What are the types of pointers in c?

972


What is the difference between strcpy() and memcpy() function in c programming?

1028


What is ctrl c called?

1002


Why #include is used in c language?

993


Do string constants represent numerical values?

1323


If you know then define #pragma?

1054