ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!

Jump to content



Photo

Simple Addition Calculator [C++]


  • Please log in to reply
Simple Addition Calculator [C++]

#1

pruned_71832103
pruned_71832103
    Offline
    2
    Rep
    122
    Likes

    cout << "Hello Pussy! \n";

  • PipPipPipPipPipPipPip
Posts: 410
Threads: 62
Joined: Apr 28, 2015
Credits: 0
Eight years registered
#1

IQ1Vg4J.gif

#include <iostream>


using namespace std;


int main()
{
    int a;
    int b;
    int sum;


    cout << "Enter number here: \n";
    cin >> a;


    cout << "Enter number to add here: \n";
    cin >> b;


    sum = a + b;
    cout << "Calculated answer: " << sum << endl;
}

Edited by HTTPS, 14 June 2015 - 09:54 PM.

  • 0

#2

pruned_71832103
pruned_71832103
    Offline
    2
    Rep
    122
    Likes

    cout << "Hello Pussy! \n";

  • PipPipPipPipPipPipPip
Posts: 410
Threads: 62
Joined: Apr 28, 2015
Credits: 0
Eight years registered
#2

Made this with the code::blocks interactive development environment (IDE).

 

Downloads:

Windows IDE + Compiler: Download

Linux IDE + Compiler: Download <- You'll need to find the one suited for your distribution.

Mac IDE + Compiler: Download


Edited by HTTPS, 14 June 2015 - 09:57 PM.

  • 0

#3

elderapo
elderapo
    Offline
    2
    Rep
    2
    Likes

    Advanced Member

Posts: 124
Threads: 0
Joined: Jan 27, 2015
Credits: 0
Eight years registered
#3

LOOOOOL XDDD I want to see more tutorials.


  • 0

#4

General
General
    Offline
    17
    Rep
    476
    Likes

    Veteran

Posts: 409
Threads: 73
Joined: May 23, 2015
Credits: 0

Eight years registered
#4
import java.util.Scanner;


class r3kt{

public static void main (String args[]){
	
	
	Scanner input = new Scanner(System.in);
	
	int fnum, snum, answer;
	
	System.out.println("Enter the first number...");
	fnum = input.nextInt();
	
	System.out.println("Enter the second number...");
	snum = input.nextInt();
	
	answer = fnum + snum;
	
	System.out.println("The answer is " + answer);
	
	

	
	}
}

Java version

 

 

Edit: Oh wait this section is just for C++/C/Obj-C   , lol


Edited by UchihaItachi, 14 June 2015 - 10:26 PM.

  • 0

Posted Image


#5

pruned_71832103
pruned_71832103
    Offline
    2
    Rep
    122
    Likes

    cout << "Hello Pussy! \n";

  • PipPipPipPipPipPipPip
Posts: 410
Threads: 62
Joined: Apr 28, 2015
Credits: 0
Eight years registered
#5
import java.util.Scanner;


class r3kt{

public static void main (String args[]){
	
	
	Scanner input = new Scanner(System.in);
	
	int fnum, snum, answer;
	
	System.out.println("Enter the first number...");
	fnum = input.nextInt();
	
	System.out.println("Enter the second number...");
	snum = input.nextInt();
	
	answer = fnum + snum;
	
	System.out.println("The answer is " + answer);
	
	

	
	}
}

Java version

 

 

Edit: Oh wait this section is just for C++/C/Obj-C   , lol

 

 

Your kind is not liked here :P


  • 0

#6

kasita
kasita
    Offline
    0
    Rep
    3
    Likes

    New Member

Posts: 20
Threads: 0
Joined: Sep 17, 2015
Credits: 0
Eight years registered
#6

lol thnaks


  • 1

#7

lovemetwo
lovemetwo
    Offline
    0
    Rep
    6
    Likes

    New Member

Posts: 24
Threads: 2
Joined: Sep 21, 2015
Credits: 0
Eight years registered
#7

oh good. Thank you man


  • 0


 Users browsing this thread: