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 |
What is meant by int fun const(int a, int b) { .... ... }
write a program to compare 2 numbers without using logical operators?
What is echo in c programming?
What is pragma c?
Why can't I perform arithmetic on a void* pointer?
write a c program to print the values in words eg:- 143 written it has (one hundred and forty three)& 104, 114 are also written words
5 Answers Captronic, DELL, Google, IBM, Mithi, RCC, Wipro,
What is a const pointer in c?
#include<stdio.h> main() { int a=1; int b=0; b=++a + ++a; printf("%d %d",a,b); }
What are the keywords in c?
Explain how can I convert a string to a number?
will u give me old quesrion papers for aptitude for L & t info tech?
How to add two numbers without using semicolon at runtime