for Loop in C Programming

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

#include<stdio.h>
#include<conio.h>
int main()
{
    // system("cls");
    // for(int i=1,j=5;i<=10&& j<=10;i++,j--)
    // {
    //      printf("i=%d  j=%d  \n",i,j);
    // }
   // int i;
    //  for( i=1;i<=10;i++)
    //  {
    //     printf("%d\n",i);
    //  }  
    //  printf("%d",i);
    // int i;
    // for(i=1;i<=10;i++);
    // printf("%d\n ",i);

    // int n,i;
    // printf("Enter a number");
    // scanf("%d",&n);
    // for(i=1;i<=10;i++)
    // {
    //     printf("%d\n",n*i);
    // }

//     int i=1;
//     int n,p,s=1;
//     printf("Enter a number");
//     scanf("%d",&n);
//     printf("Enter a  power of number");
//     scanf("%d",&p);
//     for(i=1;i<=p;i++)
//     {
//         s=s*n;
//     }
//  printf("%d to the power %d is %d ",n,p,s);








    // for(;;)
    // {
    //     printf("%d\n",i);
    //     if(i==10)
    //     break;
    //     i++;
    // }
 





    // for(;i<=10;)
    // {
    //     printf("%d\n",i);
    //     i++;
    // }











    // int i=1;
    // for(;i<=10;i++)
    // {
    //  printf("%d\n",i);
     
    // }


//    int i;
//    for(i=1;i<=10;)
//    {
//     printf("%d\n",i);
//     i++;
//    }

    // int i,sum=0;
    // for(i=1;i<=10;i++)
    // {
    //     printf("%d\n",i);
    //     sum=sum+i;
    // }
    // printf("sum is= %d",sum);
    return 0; 
}

 

Did you like our efforts? If Yes, please give DataFlair 5 Stars on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *