Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to get command arguments c++ 
Cpp :: cpp split string by space 
Cpp :: static_cast c++ 
Cpp :: how to find size of int array in c++ 
Cpp :: c++ lcm 
Cpp :: what is the difference between i++ and ++ i ? 
Cpp :: c++ code for selection sort 
Cpp :: what is the short cut way to find the max and min element in an array in c++ 
Cpp :: how to traverse a linked list in c++ 
Cpp :: C++ Program to Reverse an Integer 
Cpp :: convert int to enum c++ 
Cpp :: operands c++ 
Cpp :: C++ do...while Loop 
Cpp :: appending int to string in cpp 
Cpp :: reverse string c++ 
Cpp :: string length c++ 
Cpp :: iteraate through a vector 
Cpp :: max of a vector c++ 
Cpp :: how to change a value from an array c++ 
Cpp :: c++ create multidimensional vector 
Cpp :: how to iterate throguh a string in c++ 
Cpp :: Parenthesis Checker using stack in c++ 
Cpp :: log base 10 c++ 
Cpp :: sort 0 1 2 leetcode 
Cpp :: string substr c++ 
Cpp :: are strings mutable in c++ 
Cpp :: how to reverse a vector 
Cpp :: cannot jump from switch statement to this case label c++ 
Cpp :: how to empty an array c++ 
Cpp :: detect cycle in an undirected graph 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =