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
What will the preprocessor do for a program?
What is #include stdlib h?
What is the use of static variable in c?
Can we assign string to char pointer?
How can I list all of the predefined identifiers?
How do you print only part of a string?
Define VARIABLE?
What is a char c?
what are bit fields? What is the use of bit fields in a structure declaration?
What are the advantages of using macro in c language?
Differentiate between null and void pointers.
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
Explain the difference between exit() and _exit() function?
How do c compilers work?