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 |
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Why clrscr is used after variable declaration?
List some of the static data structures in C?
What is structure of c program?
Is javascript based on c?
#include<stdio.h> int fun(); int i; int main() { while(i) { fun(); main(); } printf("hello \n"); return 0; } int fun() { printf("hi"); } answer is hello.how??wat is tat while(i) mean?
write a program without using main function?
how to add numbers without using arithmetic operators.
Write a program to compare two strings without using the strcmp() function
42 Answers Accenture, Arba Minch University,
What is the most efficient way to count the number of bits which are set in an integer?
What is advantage of pointer in c?
what is the answer for it main() { int i; clrscr(); printf("%d",&i)+1; scanf("%d",i)-1; }