Write a C program to print the addition of the five values.

 

C program
C PROGRAM

Write a C program to print the addition of the five values

#include <stdio.h>
#include<conio.h>
void main()
{
  int a[5],sum=0,i;
  clrscr();
  printf("enter five values");
  for(i=0;i<=4;i++)
  {
    scanf("%d",&a[i]);
  sum+=a[i];
  }
  printf("the sum of given numbers is %d",sum);
  getch();
  }

OUTPUT:

enter five values3
90
190
7937
2889
the sum of given numbers is 11109
Process finished.


Comments

Popular posts from this blog

Write a program to calculate a students result based on two examinations, 1 sports event, and 3 activities conducted. The weightage of activities= 30%, sports= 20% , and examinations= 50%.

Determine the intensity of shear of an oil having viscosity= 1 poise. The oil is used for lubricating the clearance between a shaft of diameter 10 cm and its journal bearing. The clearance is 1.5mm and the shaft rotates at 150 r.p.m.