edited by
251 views
1 votes
1 votes

Consider the following C program using function :  

#include<stdio.h>
main()
{
int f1(int,int);
int x = 9, n=3, S;
S = f1(x,n);
printf(S);
}
int f1(int x, int n)
{
int y=1, i=1;
for(i=1;i<=n;i++)
y=y*x;
return(y);
}

Output will be ______

edited by

1 Answer

1 votes
1 votes
y=9, y=9*9=81, y=81*9=729 ; 729 is the answer
Answer:

Related questions

0 votes
0 votes
1 answer
1
Bikram asked May 14, 2017
351 views
Spot the error(s) in this code snippet :int n=2; // Line 1 switch(n) { case 1.5: printf( "gate"); break; case 2: printf( "overflow"); break; case 'A': printf("gateoverflo...
0 votes
0 votes
0 answers
2
Bikram asked May 14, 2017
196 views
#include <stdio.h int counter(int i) { static int count = 0; count = count + i; return count; } int main() { int i, j; for (i = 0; i <= 5; i++) j = counter(i); printf ("%...
1 votes
1 votes
1 answer
3
Bikram asked May 14, 2017
291 views
What is the output of the following program?#include <stdio.h int main() { int a = 0; switch(a) { default: a = 4; case 6: a ; case 5: a = a+1; case 1: a = a-1; } printf("...
7 votes
7 votes
2 answers
4
Bikram asked May 14, 2017
538 views
What is the output of the following code snippet? #include <stdio.h int main() { char c=125; c=c+10; printf("%d",c); return 0; }