Our website is made possible by displaying online advertisements to our visitors.Please consider supporting us by disabling your ad blocker.
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Translate it in your own Language

Print this Job Post

Print Friendly and PDF

Monday, May 5, 2014

C program to add n numbers

C programming code


#include <stdio.h>
#include<conio.h> 
void main()
{
   int n, sum = 0, c, value;
   printf("Enter the number of integers you want to add\n");
   scanf("%d", &n);
   printf("Enter %d integers\n",n);
   for (c = 1; c <= n; c++)
   {
      scanf("%d",&value);
      sum = sum + value;
   }
   printf("Sum of entered integers = %d\n",sum);
   getch();
}

No comments:

Post a Comment

Copyright @ CrackMNC 2014-2024
Divas Nikhra Theme by Crack MNC