1. 程式人生 > >C語言循環

C語言循環

size mark pau pri use tdi printf %d stdio.h

1.

#include<stdio.h>

#include<stdlib.h>

void main(){

int l_count=1;

mark:

printf("第%d次,我熱愛編程\n",l_count)

l_count++;

if(l_count<6){

go to mark;

}

system("pause");

}

2.

#include<stdio.h>

#include<stdlib.h>

void main(){

for(size_t i=1; i<6: i++){

printf("第%d次,我熱愛編程\n",i);

}

system("pause");

}

3.

#include<stdio.h>

#include<stdlib.h>

void main(){

int l_sum=0

for(size_t i=1, i<6: i++){

int l_sum=int l_sum+i

}

printf("sum is %d\n",l_sum);

system("pause");

}

C語言循環