Answer to Question #10341 in C++ for Benjamin

Question #10341
c program that generate all even numbers between 1 and 100 and sum two fractions
1
Expert's answer
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS