for(int i = 0; i<n ;i++) //i is the number of iterations that occur
{ //n is the total number of iterations
//code here
}
int i;
for (i = 0; i < n; ++i) { // n is the number of iterations
// Code here
}
for(int i=0; i<10; i++)
printf("%d ", i) /* displays: 0 1 2 3 4 5 6 7 8 9 */
#include <stdio.h>
int main() {
int i;
for (i=0; i < 10; i++){
printf("%d", i);
}
return 0;
}
for(int i=0;i<5;i++)
int i;
for(i=0; i<5; i++)
{
printf("Nummber %d
", i+1);
}
#include<stdio.h>
int main()
{int i;
for(i=1;i<8;i++){
printf("
kaif alam");
}
return 0;
}
//the syntax of the for loop statement is: for(init;condition;inc/dec) {statement(s)}
//init=initialization
//inc=increment|incrementation formula is i++ or ++i
//dec=decrement|decrementation formula is i-- or --i
#include<stdio.h>
main()
{
int n;
for(n=1;n<=4;n++)
{
printf("%d, ",n);
}
printf("%d.",n);
}
Code Example |
---|
:: |
:: |
C :: libdvd-pkg: `apt-get check` failed |
:: convert number to string c |
C :: |
:: |
C :: |
:: |
C :: |
:: stdio |
:: |
:: |
:: install gnome tweaks ubuntu 20.04 |
:: initialize array in c with 0 |
C :: |
:: |
C :: |
:: |
:: identifier bool is undefined in c |
C :: |
:: |
:: |
:: |
C :: |
C :: getchar c |
C :: c add char to char array |
:: |
C :: |
:: yt derived field |
C :: |