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
pierrot's divisor program using c or c++ code
What is c programming structure?
Where can I get an ansi-compatible lint?
What is the difference between array and pointer?
What is the size of structure in c?
What is the size of enum in c?
What are the primitive data types in c?
What is the purpose of the statement: strcat (S2, S1)?
What is the purpose of the preprocessor directive error?
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
What is the benefit of using const for declaring constants?
Why & is used in c?
What is the difference between functions getch() and getche()?
What is the purpose of 'register' keyword in c language?
Why do we use stdio h and conio h?