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 / 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 |
In a byte, what is the maximum decimal number that you can accommodate?
Combinations of fibanocci prime series
What is time complexity c?
What is the difference between fread buffer() and fwrite buffer()?
How can a program be made to print the name of a source file where an error occurs?
How to write a code for reverse of string without using string functions?
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
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Hi, main() { } Is a user defined function or Built in Functionn
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?
What is the purpose of sprintf() function?