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

Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1126


What are the advantages and disadvantages of a heap?

1214


Why doesnt the call scanf work?

1195


what is recursion in C

1069


What is cohesion and coupling in c?

1033


How many keywords (reserve words) are in c?

1142


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3690


Why c is a procedural language?

1059


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1222


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2838


Explain what is the difference between a free-standing and a hosted environment?

1185


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1064


What is exit() function?

1022


What is the use of static variable in c?

1091


Why is struct padding needed?

1088