Tuesday, March 5, 2024

7. 1+2+3+4+...+10 :—

7. 1+2+3+4+...+10 :—


#include<stdio.h>

int main()

{

    int i,sum;

    sum=0;

    for(i=1;i<=10;i++)

    {

        sum=sum+i;

    }

    printf("%d",sum);

    return 0;

}


No comments:

Post a Comment