In this tutorial, we are going to write a C program to call the function through the for loop in C Programming with practical program code and step-by-step full complete explanation.
C program to call the function through the for loop
#include<stdio.h> #include<conio.h> #include<process.h> #include<stdlib.h> void main() { int plus(int), m=1; clrscr(); for(; plus(m); m++) { printf("%3d",m); } } int plus(int k) { if(k==10) { exit(1); return NULL; } else return(k); }
Output
1 2 3 4 5 6 7 8 9
0 Comments