frijj's Profile
Reputation: 0
Apprentice
- Group:
- Members
- Active Posts:
- 33 (0.14 per day)
- Joined:
- 01-October 12
- Profile Views:
- 303
- Last Active:
Apr 24 2013 12:39 PM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: (C++) adding all the numbers up in each section.
Posted 18 Apr 2013
frijj, on 18 April 2013 - 04:56 AM, said:#include <iostream> using namespace std; int main () { double n; cout<<"Enter first number\n"; cin>>n; printf("\nX X^2 X^3 Sqrt(X) \n"); for (int i = 1; i <= n; i++) { cout << i << " " << i*i << " "<< i*i*i << " " <<sqrt(i) <<endl; } printf("\n====================================================\n"); printf("\nTotal: \n"); printf("\n====================================================\n"); return 0; }
So far i went for this, all i want to do is to total the results in each section in which i have confused myself.
OK, i have managed to total one of them,
#include <iostream> using namespace std; int main () { double sum; double n; sum = 0; cout<<"Enter first number\n"; cin>>n; printf("\nX X^2 X^3 Sqrt(X) \n"); for (int i = 1; i <= n; i++) { sum = sum + i; cout << i << " " << i*i << " "<< i*i*i << " " <<sqrt(i)<<" "<< sum <<endl; } printf("\n====================================================\n"); printf("\nTotal: \n"); printf("\n====================================================\n"); return 0; }
It pretty much adds up all numbers for X, but it shows a running total on right going from 1 to 3 to 6, i just want it to show the end number only 15, any directions on how to do that? -
In Topic: (C++) adding all the numbers up in each section.
Posted 18 Apr 2013
#include <iostream> using namespace std; int main () { double n; cout<<"Enter first number\n"; cin>>n; printf("\nX X^2 X^3 Sqrt(X) \n"); for (int i = 1; i <= n; i++) { cout << i << " " << i*i << " "<< i*i*i << " " <<sqrt(i) <<endl; } printf("\n====================================================\n"); printf("\nTotal: \n"); printf("\n====================================================\n"); return 0; }
So far i went for this, all i want to do is to total the results in each section in which i have confused myself. -
In Topic: (C++) adding all the numbers up in each section.
Posted 17 Apr 2013
-
In Topic: Converting fahrenheit to celsius
Posted 17 Apr 2013
-
In Topic: Javascript shortening
Posted 13 Dec 2012
Can you give give me another example please?
I need to get a better idea, currently bit not sure. ive tried doing some but i failed.
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
|
|


Find Topics
Find Posts
View Reputation Given

|
Comments
frijj has no profile comments yet. Why not say hello?