Algoritma&Struktur Data Pertemuan ke -7
Algorima & Struktur Data Assalamualaikum wr,wb Nama : Nasrudin Nim : 3420210031 Jurusan Tenik Informatika 1. contoh ke -1 #include <iostream.h> #include <conio.h> //Nama: Nasrudin //NIM: 3420210031 //Prodi: Teknik Informatika void main () { int i; int a = 2; int b = 4; cout<<"------------------------------\n"; cout<<" No A B A*A B*B\n"; cout<<"------------------------------\n"; for (i=1; i<=10; i++) { gotoxy (2,3+i); cout<<i; gotoxy (7,3+i); cout<<a; gotoxy (12,3+i); cout<<b; gotoxy (17,3+i); cout<<a*a; gotoxy (23,3+i); cout<<b*b; a=a+2; b=b+3; cout<<"\n"; } cout<<"------------------------------\n"; getch(); } 2. contoh ke -2 #include <stdio.h> #include <conio.h> #include "iostream.h" //Nama : Nasrudin //NIM : 3420210031 //Prodi : Teknik In