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

Explain how does free() know explain how much memory to release?

731


What are the complete rules for header file searching?

828


define string ?

837


Explain a file operation in C with an example.

839


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

1838






Which header file is used for clrscr?

750


What is the scope of static variable in c?

687


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1084


Tell me what is null pointer in c?

749


What is wrong with this declaration?

806


How to compare array with pointer in c?

801


Can i use “int” data type to store the value 32768? Why?

942


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

862


What are valid signatures for the Main function?

889


What is the full form of getch?

822