SELAMAT DATANG DI BLOG TEKNIK INFORMATIKA 17.8B.33 UNIVERSITAS BSI BANDUNG

Rabu, 07 Desember 2011

Algoritma dan Pemrograman : Matrix Perkalian

#include<conio.h>
#include<stdio.h>
#include<iostream.h>

main ()
{
    int a,b,hasil,total;
   total=0;
   for(a=1; a<=5; a++)
   {
       hasil=1;
      for(b=5; b>=a; b--)
      {
          if(b==5)
          {
          cout<<b;
          }
          else
          {
          cout<<"x"<<b;
          }
      hasil*=b;
      }

    gotoxy(10,a); cout<<"= "<<hasil;
    total+=hasil;
    cout<<endl;


    }

   cout<<"---------------+";
cout<<endl<<"Total\t = "<<total;
getche ();
}

Outputnya:




0 komentar:

Posting Komentar

Bagikan

Twitter Delicious Facebook Digg Stumbleupon Favorites More