Kamis, 13 November 2025

ex0903.c for() & printf("%d\t", duo)

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

int main()
{
    int duo;

    for(duo=2; duo<=20; duo=duo+2)
    {
        printf("%d\t", duo);
    }
    putchar('\n');
    return(0);
}

output:
 
2       4       6       8       10      12      14      16      18      20

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

Contoh penggunaan looping for() & printf("%d\t", duo).

Tidak ada komentar:

Posting Komentar