Tuesday, April 14, 2020

For loop in C

  • Flowchart :



  • Syntax :
for (initialization; condition; increment ) 
{   
//statement block;
}
  • Program :
#include<stdio.h> 
#include<conio.h> 
int main ()
{
  int n,time,i;
  clrscr(); 
  printf("\n----------------FOR LOOP----------------");
  printf("\nEnter n and time value :");
  scanf("%d%d",&n,&time);
   for(i=n;i<=time;i=i+1)
   {
      printf("\n n : %d",i);
   }
   getch();
}

  • Output :




No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...