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 |
how to swap two nubers by using a function with pointers?
Explain pointers in c programming?
Why #include is used in c language?
What is pass by reference in functions?
write a c program in such a way that if we enter the today date the output should be next day's date.
difference between c and c++?
Derive the complexity expression for AVL tree?
Do you know null pointer?
Explain what is wrong with this program statement? Void = 10;
How to delete a node from linked list w/o using collectons?
AMMONG THE 4 STROAGE CLASSES IN C, WHICH ONE FASTEST?
What is a char in c?