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 |
Explain union. What are its advantages?
what are the different storage classes in c?
Explain what are multidimensional arrays?
Do array subscripts always start with zero?
wat is the output int main() { char s1[]="Hello"; char s2[]="Hello"; if(s1==s2) printf("Same"); else printf("Diff"); }
How can you avoid including a header more than once?
Write one statement equalent to the following two statements x=sqr(a); return(x); Choose from one of the alternatives a.return(sqr(a)); b.printf("sqr(a)"); c.return(a*a*a); d.printf("%d",sqr(a));
Write a program to generate the first n terms in the series --- 9,11,20,31,...,82
What is the most efficient way to count the number of bits which are set in a value?
What are nested functions in c?
How do I swap bytes?
What is the difference between printf and scanf )?