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

int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10
i++;
}
printf("%d", i);

Answer Posted / guest

the print would be 20.

the problem is about scope. the first i=10 is global scope.
But inside main() comes function scope. So i=20. The i
inside the for loop is of block scope and does not affect
the i outside it.

Is This Answer Correct ?    5 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does 1f stand for?

1092


Why do some versions of toupper act strangely if given an upper-case letter?

1041


Explain what are header files and explain what are its uses in c programming?

1113


How do I read the arrow keys? What about function keys?

1021


What are the advantages of using new operator as compared to the function malloc ()?

1273


Why array is used in c?

975


How do c compilers work?

1050


Write program to remove duplicate in an array?

1029


Can you please explain the difference between malloc() and calloc() function?

1053


Why functions are used in c?

1074


How can I invoke another program or command and trap its output?

1049


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2415


Explain what is a pragma?

996


how to execute a program using if else condition and the output should enter number and the number is odd only...

2211


What is the difference between scanf and fscanf?

1203