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
What are the rules for identifiers in c?
Are negative numbers true in c?
exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above
Is there any possibility to create customized header file with c programming language?
Can 'this' pointer by used in the constructor?
Can a local variable be volatile in c?
Which of these functions is safer to use : fgets(), gets()? Why?
What is a global variable in c?
What is array of structure in c?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
What is the difference between procedural and functional programming?
Explain a pre-processor and its advantages.
Difference between macros and inline functions? Can a function be forced as inline?
What is %d used for?
What is 2c dna?