//---------------------------------------------------------------------------
#include <vcl\condefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USERES("tabelKali.res");
//---------------------------------------------------------------------------
void tabelKali(int n) {
for(int i=0; i<=n; i++) {
for(int j=1; j<=n; j++) {
if(i==0 && j==1)
printf(" x ");
if(i==0)
printf("%3d ",j);
if(i!=0)
printf("%3d ",(i*j));
}
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("\nOUTPUT : \n\n");
tabelKali(n);
getch();
return 0;
}
//---------------------------------------------------------------------------
download : https://www.dropbox.com/s/rt93pje4qm2jq5z/tabelKali.cpp
alternatif : https://www.dropbox.com/sh/s9x8bzqvifio6mu/gDGh6bYezQ
Subscribe to:
Post Comments (Atom)






0 comments:
Post a Comment