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

In the below code, how do you modify the value 'a' and print
in the function. You'll be allowed to add code only inside
the called function.

main()
{
int a=5;
function(); // no parameters should be passed
}
function()
{
/* add code here to modify the value of and print here */
}

Answer Posted / aravind

#include<stdio.h>
void function(void );
int main()
{
int a=5;
function();
}
function()
{
int a=4;
printf("%d",a); /* a here is a local variable*/
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

pierrot's divisor program using c or c++ code

2164


What is c programming structure?

1104


Where can I get an ansi-compatible lint?

1098


What is the difference between array and pointer?

963


What is the size of structure in c?

1091


What is the size of enum in c?

1050


What are the primitive data types in c?

1006


What is the purpose of the statement: strcat (S2, S1)?

1057


What is the purpose of the preprocessor directive error?

1193


The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none

1183


What is the benefit of using const for declaring constants?

987


Why & is used in c?

1115


What is the difference between functions getch() and getche()?

1031


What is the purpose of 'register' keyword in c language?

976


Why do we use stdio h and conio h?

1029