Answer to Question #10341 in C++ for Benjamin
c program that generate all even numbers between 1 and 100 and sum two fractions
1
2012-06-05T07:36:07-0400
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int sum=0;
cout<<"Even numbers:";
for(int i=1;i<=100;i++){
if(i%2==0){
cout<<i<<" ";
}
sum+=i;
}
cout<<"
Sum of two fractions is "<<sum/2;
int k;
cin>>k;
return 0;
}
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment