Quick actions

cmd+k|ctrl+k

Navigation

Languages

Latihan 7.1

Snippet info

Language

Cpp

Visibility

public

Author

sarahahmadmaula1104

Created

2024-11-16T01:11:49.061066Z

Updated

2024-11-16T04:31:17.102687Z

#include <iostream>
using namespace std;

void judul() {
    puts("----------------------------------");
    puts(" No   A   B   A*A  A*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("=====================================");
    cout<<"Nama : Sarah Ahmad Maula"<<endl;
    cout<<"Email: [email protected]"<<endl;
    return 0;
}
INFO