Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to make a c++ program which takes two integers and calculate average

#include<iostream>
using namespace std;
int main(){
	float average, num1, num2;
	cout << "ENTER INTEGER 1: ";
	cin >> num1;
	cout << "ENTER INTEGER 2: ";
	cin >> num2;
	average = (num1 + num2)/2;
	cout << "AVERAGE IS: " << average;
}
 
PREVIOUS NEXT
Tagged: #program #takes #integers #calculate #average
ADD COMMENT
Topic
Name
7+3 =