Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tugas algoritma 3-1

Snippet info

Language

Cpp

Visibility

public

Author

raffaisnurasha25

Created

2025-10-18T15:06:53.307199Z

Updated

2025-10-18T15:48:49.38037Z

#include <iostream>
using namespace std;

int main() {
    int x,y;
    cout<<"------------------------------\n";
    cout<<"masukan nilai x \t= \n"; cin>>x;
    cout<<"masukan nilai y \t= \n"; scanf("%d",&y);
    cout<<"------------------------------\n";
    printf("NILAI X ADALAH \t\t= %i\n",x);
    printf("NILAI y ADALAH \t\t= %i\n",y);
    const int a=x+y,b=x-y,c=x/y,d=x*y;
    cout<<"------------------------------";
    cout<<endl;
    printf("HASIL DARI X+Y ADALAH \t= %i\n",a);
    printf("HASIL DARI X-Y ADALAH \t= %i\n",b);
    printf("HASIL DARI X/Y ADALAH \t= %i\n",c);
    printf("HASIL DARI X*Y ADALAH \t= %i\n",d);
    cout<<"------------------------------\n";
    //RAFFAIS NUR ASHA
    //3420240013
    return 0;
}
INFO