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

What is a file descriptor in c?

1199


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

1153


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.

2023


Which control loop is recommended if you have to execute set of statements for fixed number of times?

1410


Without Computer networks, Computers will be half the use. Comment.

2356


What are the benefits of c language?

1228


Why are algorithms important in c program?

1174


Why c is faster than c++?

1091


Is c programming hard?

1081


What is scope and lifetime of a variable in c?

1120


Write a program to print ASCII code for a given digit.

1128


How can I call a function with an argument list built up at run time?

1287


is it possible to create your own header files?

1165


how do you programme Carrier Sense Multiple Access

2010


What is the difference between malloc() and calloc()?

1983