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
Explain how does free() know explain how much memory to release?
What are the complete rules for header file searching?
define string ?
Explain a file operation in C with an example.
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?
Which header file is used for clrscr?
What is the scope of static variable in c?
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.
Tell me what is null pointer in c?
What is wrong with this declaration?
How to compare array with pointer in c?
Can i use “int” data type to store the value 32768? Why?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What are valid signatures for the Main function?
What is the full form of getch?