xachetbay

1+2+n

Mar 13th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.17 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. int main()
  4. {
  5.  
  6.     printf("Nhap n: "); int n,m,i ; scanf("%d",&n);
  7.    
  8.     for (i = 1; i <= n; i++){
  9.         m += i;
  10.     }
  11.     printf("KQ = %d",m);
  12.    
  13. }
Advertisement
Add Comment
Please, Sign In to add comment