Kamis, 13 November 2025

ex0902.c for(count) & printf("%d\n", count)

/* ex0902.c */
#include <stdio.h>

int main()
{
    int count;

    for(count=-5; count<6; count=count+1)
    {
        printf("%d\n", count);
    }
    return(0);
}

output:
 
-5
-4
-3
-2
-1
0
1
2
3
4
5

Process returned 0 (0x0)   execution time : 0.069 s
Press any key to continue.

Contoh penggunaan looping for().

Tidak ada komentar:

Posting Komentar