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
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Explain what is the benefit of using an enum rather than a #define constant?
How do you determine whether to use a stream function or a low-level function?
What are the differences between new and malloc in C?
What is omp_num_threads?
Are pointers really faster than arrays?
What functions are in conio h?
What is pass by reference in functions?
Write a c program to demonstrate character and string constants?
What do you mean by command line argument?
Tell me about low level programming languages.
What is the most efficient way to count the number of bits which are set in an integer?
Is it fine to write void main () or main () in c?
What’s the special use of UNIONS?
How do we open a binary file in Read/Write mode in C?