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.
1
Expert's answer
2012-10-09T08:40:01-0400
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"; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment