Program that accepts temperature of 7 days from user and print their average using array

7 days temperature from user and print their average using array

Write a program that accepts temperature of 7 days from user and print their average using array

Object: Write a program that accepts temperature of 7 days from user and print their average using array. C++ projects for beginners with source code

Code:

#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
float temp[7],sum=0,avg;
int i;
cout<<“Enter 7 days Tempreature:\n”;
for(i=0;i<7;i++)
{
cin>>temp[i];
sum+=temp[i];
}
avg=sum/7;
cout<<“Average of 7 days Temperature is:”<<avg;
getch();
}

Output:

Program that accepts temperature of 7 days from user and print their average using array

M.A Siddiqui

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *