[C] How to use for loop with C

#include<stdio.h>
 
int main(int argc, char *argv[]){
 
    int result = 0;
    int i = 0;
    for(i = 1; i <= 1000; i++){
        result += i;
    }
 
    printf("sum of 1 to 1000 : %d\n", result);
    return 0;
 
}


Comments

Popular posts from this blog

[OpenCV] What is gocv?

[OpenCV] Chapter01-05 Working with UI elements such as scrollbars in OpenCV window

[OpenCV] How to set up gocv