Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas7.1

Snippet info

Language

Cpp

Visibility

public

Author

syifanirwana

Created

2024-11-16T01:59:19.317065Z

Updated

2024-11-22T03:57:50.492729Z

#include <iostream>
using namespace std;

void judul() {
    puts("-------------------------------------------");
    puts(" No   A   B   A*A  B*B");
    puts("-------------------------------------------");
}

int main() {
    judul();
    int i;
    int a = 2;
    int b = 4;
    float no[10];
    no[0] = 1;
    no[1] = 2;
    no[2] = 3;
    no[3] = 4;
    no[4] = 5;
    no[5] = 6;
    no[6] = 7;
    no[7] = 8;
    no[8] = 9;
    no[9] = 10;
    
    for(i=1;i<=10;i++)
    {
        printf("%3d%4d%4d%5d%5d\n",i,a,b,a*a,b*b);
        a=a+2;
        b=b+3;
    }
    
    puts("-------------------------------------------");
    puts("Nama  : Syifa Asih Nirwana");
    puts("NIM   : 1620230019");
    puts("Email : [email protected]");
    return 0;
}

    

INFO