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 |
Explain enumerated types.
write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
How to write a code for random pick from 1-1000 numbers? The output should contain the 10 numbers from the range 1-1000 which should pick randomly, ie ,for each time we run the code we should get different outputs.
What is the deal on sprintf_s return value?
Write a program in c to print * * * * * *******
How are Structure passing and returning implemented by the complier?
which one of follwoing will read a character from keyboard and store in c a)c=getc() b)c=getchar() c)c=getchar(stdin) d)getc(&c) e)none
What is string function c?
What is the difference between union and structure in c?
how to multiply two number taking input as a string (considering sum and carry )
discuss the steps needed to get a program from source code to executable in a system?