casper. Powered by Blogger.

Blog ini bertujuan untuk share ilmu dan pengetahuan. Semua source/aplikasi di blog ini bebas disebar dan mencamtumkan sumber "fandy-alfa.blogspot.com".

RSS

Program C Tabel Penjumlahan

//---------------------------------------------------------------------------
#include <vcl\condefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>

#pragma hdrstop
//---------------------------------------------------------------------------
USERES("tabelTambah.res");
//---------------------------------------------------------------------------
void tabelTambah(int n) {
    for(int i=0; i<=n; i++) {
        for(int j=1; j<=n; j++) {
            if(i==0 && j==1)
                printf("  +  ");
            if(i==0)
                printf("%3d ",j);
            if(i!=0)
                printf("%3d ",(j+i));
        }
        if(i==0)
            printf("\n----");
        if(i!=n)
             printf("\n%3d| ",(i+1));
    }
}

int main(int argc, char **argv)
{
     int n;
    printf("Masukkan nilai n : "); scanf("%d",&n);
    printf("\n OUTPUT : \n\n");
    tabelTambah(n);
    getch();
    return 0;
}
//---------------------------------------------------------------------------

download :: https://www.dropbox.com/s/tc1u6um63ywanhw/tabelTambah.cpp
alternatif : https://www.dropbox.com/sh/s9x8bzqvifio6mu/gDGh6bYezQ
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comments:

Post a Comment