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 ______
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); }
64.3k questions
77.9k answers
244k comments
80.0k users