2 2 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 ______ Programming in C tbb-programming-2 numerical-answers programming-in-c output functions + – Bikram 752 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote y=9, y=9*9=81, y=81*9=729 ; 729 is the answer Bikram answered May 14, 2017 Bikram comment Share Follow See all 3 Comments 3 3 Comments reply Ashwin Kulkarni commented Oct 29, 2017 reply Follow flag @Bikram Sir what about prototyping of f1 function ? Is it allowed in main() ? 0 0 replyShare Satyajeet Singh commented Jan 11, 2018 reply Follow flag Yes we can provide the prototyping in main() also .. the only condition is that it must occur before the function call... e.g. int main(){ void foo(int); foo(1); return 0; } void foo(int n){ printf("%d", n); } 1 1 replyShare Sidd1425 commented Dec 11, 2024 reply Follow flag it should be printf("%d",S); only printf(S) does not print anything. 0 0 replyShare Please log in or register to add a comment.