frijj's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
33 (0.14 per day)
Joined:
01-October 12
Profile Views:
303
Last Active:
User is offline Apr 24 2013 12:39 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   frijj has not set their status

Posts I've Made

  1. In Topic: (C++) adding all the numbers up in each section.

    Posted 18 Apr 2013

    View Postfrijj, 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?
  2. 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.
  3. In Topic: (C++) adding all the numbers up in each section.

    Posted 17 Apr 2013

    View PostSkydiver, on 17 April 2013 - 06:50 AM, said:

    Instead of printing the results of each calculation straight to the console using printf(), store the results into variables, and then have another set of variables that are the sums.

    How would i go about doing this?
  4. In Topic: Converting fahrenheit to celsius

    Posted 17 Apr 2013

    View Postjjl, on 16 April 2013 - 01:15 PM, said:

    @ neondayz, He is using C++, not C.

    http://www.cplusplus.../iostream/cout/


    Thank you, completed it all.
  5. 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

Comments

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