Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas 7.1

Snippet info

Language

Cpp

Visibility

public

Author

nazwasalsabilah57

Created

2024-11-16T02:10:25.57349Z

Updated

2024-11-18T04:27:02.326986Z

#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("------------------------------------------------");
    cout<<"Nama : Nazwa Salsabilah"<<endl;
    cout<<"Email: [email protected]"<<endl;

    return 0;
}
INFO