#include<stdio.h>
#include<conio.h>
main()
{
int n,newn,i,sum=0;
clrscr();
printf("Enter number : ");
scanf("%d",&n);
printf("Numbers entered....\n");
for(i=1;i<=n;i++)
{
scanf("%d",&newn);
sum=sum+newn;
}
printf("Sum of given n digits is... %d",sum);
}
why do we need newn variable? we can solve it by using the variable i…
like sum=sum+i
A variable name can be anything, but it must be descriptive. Here new is used for a new number to accept from the user. The problem statement is to add users given the number and not the index.