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
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
What are the advantages and disadvantages of a heap?
Why doesnt the call scanf work?
what is recursion in C
What is cohesion and coupling in c?
How many keywords (reserve words) are in c?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
Why c is a procedural language?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Explain what is the difference between a free-standing and a hosted environment?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What is exit() function?
What is the use of static variable in c?
Why is struct padding needed?