64 570
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #15888 in C++ for Ahmed

Question #15888
1- Write a C++ program that reads in two integers and then
outputs both their sum and their product.
2- Write a C++ program that output the even numbers only
from 1 to 100, one per line.
Expert's answer
1).

#include<iostream.h>

int a,b;

void main(){
cout<<"Enter the first integer: ";
cin>>a;
cout<<"Enter the second integer: ";
cin>>b;
cout<<"Sum: "<<a+b<<"\nProduct: "<<a*b<<"\n";
}


2).

#include<iostream.h>

int a,b;

void main(){
for (int i=1; i<=100; i++)
& if (i%2==0) cout<<i<<"\n";
}





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions