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

Why does this code crash?

1101


What do you understand by friend-functions? How are they used?

1210


Is c++ based on c?

1074


What is ambagious result in C? explain with an example.

2638


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1122


What is the default value of local and global variables in c?

1048


Does c have class?

1122


Is main is a keyword in c?

1129


In C programming, how do you insert quote characters (ā€˜ and ā€œ) into the output screen?

1534


Explain what is the difference between functions getch() and getche()?

1056


Write a Program to find whether the given number or string is palindrome.

1280


Why #include is used in c language?

1054


What is "Hungarian Notation"?

1117


What does node * mean?

1231


What are comments and how do you insert it in a C program?

1253