Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /*
- * File: main.cpp
- * Author: FALDI
- *
- * Created on January 22, 2017, 7:16 PM
- */
- #include <iostream>
- using namespace std;
- /*
- *
- */
- int main(int argc, char** argv) {
- int hasilkuadrat, hasiljumlahkuadrat, b;
- for(int a=1;a < 51;a++) {
- b += a;
- hasilkuadrat = hasilkuadrat + (a * a);
- hasiljumlahkuadrat = b * b;
- }
- cout << hasiljumlahkuadrat - hasilkuadrat;
- return 0;
- }
Add Comment
Please, Sign In to add comment