Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. /*
  2.  * Project licenced to TheMartes
  3.  * @ hello@themartes.com
  4.  * DateTime:
  5.  * 6.18.2018
  6.  */
  7.  
  8. #include <stdio.h>
  9.  
  10. int main() {
  11.     int gimmeNumba, countedNumba = 0;
  12.  
  13.     printf("Gimme a number\n");
  14.     scanf("%d", &gimmeNumba);
  15.  
  16.     if (gimmeNumba <= 0) {
  17.         printf("Hey, bang me so hard");
  18.     } else {
  19.         for (int i = 0; i <= gimmeNumba; ++i) {
  20.             countedNumba = countedNumba + i;
  21.         }
  22.  
  23.         printf("Your number is %d", countedNumba);
  24.     }
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement