avatar
Tính Tổng n

dunghoa1984 1,671 3rd Sep, 2019

                                           
                         #include<stdio.h>
int main(){
	int i=0,n;
	long s=0;
	printf("nhap gia tri n:");
	scanf("%d",&n);
	while(i<=n){
		s=s+i;
		i++;
	}
	printf("Tong 1+2+3+...+%d=%d",n,s);
	return 0;
}
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data

Comments

Authentication required

You must log in to post a comment.

Log in
    There are no comments yet.