C program to add n numbers
C program to add n numbers
#include<stdio.h>
#include<conio.h> void main() { int n,count=1; float a,sum=0; printf("Enter the value of n\n"); scanf("%d",&n); while(count<=n) { printf("Enter number\n"); scanf("%f",&a); sum=sum+a,count++; } printf("Sum = %f",sum); getch(); }