Computer Science, asked by CharmiNagzviju, 1 year ago

Program to Print the Number from 1 to 10
Write a program to print the number from 1 to 10, and also display its total Value?

Answers

Answered by yasas
0
simply start as
#include<stdio.h>
void main()
{
  int i,n, sum=0;
clrscr();
for(i=1;i<=10;i++)
{
    printf("%d\n",i);
  sum=sum+i;
}
printf("sum is%d",sum);
getch();
}
Similar questions