consider the following C code
main()
{
int i=3,x;
while(i>0)
{
x=func(i);
i--;
}
int func(int n)
{
static sum=0;
sum=sum+n;
return(sum);
}
the final value of x is

Answer Posted / vignesh1988i

the final value of x is 6

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is void pointers in c?

582


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1196


What is difference between far and near pointers?

604


What are control structures? What are the different types?

593


Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"

1580






What are the data types present in c?

623


When the macros gets expanded?

780


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

2736


What are the rules for the identifier?

667


When we use void main and int main?

588


What is the difference between formatted&unformatted i/o functions?

610


Does free set pointer to null?

555


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

680


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

652


Multiply an Integer Number by 2 Without Using Multiplication Operator

316