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 */
}



In the below code, how do you modify the value 'a' and print in the function. You'l..

Answer / 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

More C Interview Questions

In a byte, what is the maximum decimal number that you can accommodate?

0 Answers  


Combinations of fibanocci prime series

0 Answers  


What is time complexity c?

0 Answers  


What is the difference between fread buffer() and fwrite buffer()?

0 Answers  


How can a program be made to print the name of a source file where an error occurs?

0 Answers  


How to write a code for reverse of string without using string functions?

0 Answers   TCS,


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

0 Answers  


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

0 Answers  


Hi, main() { } Is a user defined function or Built in Functionn

26 Answers   Honeywell, Yahoo,


What is the Difference between Macro and ordinary definition?

3 Answers   Bosch, Cognizant, College School Exams Tests, Motorola,


What are bitwise shift operators in c programming?

0 Answers  


What is the purpose of sprintf() function?

0 Answers  


Categories