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 |
Can the “if” function be used in comparing strings?
write a program to compare 2 numbers without using logical operators?
I have a function which accepts a pointer to an int. How can I pass a constant like 5 to it?
write a program to interchange the value between two variable without using loop
What is a struct c#?
Is c weakly typed?
Do you know pointer in c?
What is string concatenation in c?
What are conditional operators in C?
Write a C program where input is: "My name is xyz". output is: "xyz is name My".
What are the applications of c language?
Why main function is special give two reasons?