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
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Explain about C function prototype?
Explain what is the difference between #include and #include 'file' ?
What are the advantages and disadvantages of a heap?
Is printf a keyword?
What is the most efficient way to count the number of bits which are set in an integer?
What are the different types of linkage exist in c?
What is c mainly used for?
What is pointers in c?
Can you return null in c?
Why c is known as a mother language?
What does double pointer mean in c?
What is the use of getchar() function?
What library is sizeof in c?
What is c method?