Introduction to fundamental Data types: Fundamental data types are predefined data types available with C++.There are five fundamental data types in C++: - char - int - float - double - void...
// C++ program to find the total marks and average of three subjects INPUT: #include<iostream> using namespace std; int main() { int a,b,c,sum,avg; cout<<"\n Enter Mark 1:"; cin>>a; cout<<"\n Enter Mark 2:"; cin>>b; cout<<"\n Enter Mark 3:"; cin>>c; sum = a + b + c; avg = sum / 3; cout<<"\n The sum = "<<sum; cout<<"\n The average = "<<avg<<"%"; } OUTPUT:
Comments
Post a Comment