You are viewing our Forum Archives. To view or take place in current topics click here.
Need help with a project ( C# )
Posted:

Need help with a project ( C# )Posted:

SHOTTYLEAN
  • Spooky Poster
Status: Offline
Joined: Nov 09, 200914Year Member
Posts: 217
Reputation Power: 558
Motto: God forgives, I don't.
Motto: God forgives, I don't.
Status: Offline
Joined: Nov 09, 200914Year Member
Posts: 217
Reputation Power: 558
Motto: God forgives, I don't.
I need to make a program that adds the sum of the numbers between two given integers
that are evenly divisible by another given integer.

If you can help at all it would be greatly appreciated.
#2. Posted:
AvP_Coding
  • Junior Member
Status: Offline
Joined: Jul 08, 201211Year Member
Posts: 68
Reputation Power: 2
Status: Offline
Joined: Jul 08, 201211Year Member
Posts: 68
Reputation Power: 2
What lmao... so add two numbers together and divide?
#3. Posted:
Diablo_Botter
  • New Member
Status: Offline
Joined: Oct 27, 201211Year Member
Posts: 10
Reputation Power: 0
Status: Offline
Joined: Oct 27, 201211Year Member
Posts: 10
Reputation Power: 0
SHOTTYLEAN wrote I need to make a program that adds the sum of the numbers between two given integers
that are evenly divisible by another given integer.

If you can help at all it would be greatly appreciated.
Really? That seems easy enough to do. Give me a day though. I'm pretty tired right now. PM me to remind me.
#4. Posted:
zazmodz
  • V5 Launch
Status: Offline
Joined: Nov 11, 201211Year Member
Posts: 74
Reputation Power: 4
Status: Offline
Joined: Nov 11, 201211Year Member
Posts: 74
Reputation Power: 4
5 == 5
9== 9

5 + 5 / 9 =
#5. Posted:
Boolean
  • V5 Launch
Status: Offline
Joined: Jan 04, 201113Year Member
Posts: 1,732
Reputation Power: 72
Status: Offline
Joined: Jan 04, 201113Year Member
Posts: 1,732
Reputation Power: 72
Not sure if this is what you want just wrote it real quick if you want to change it around making it division,multiplication,etc. Hope I helped somewhat.


#include <iostream>

int add(int x,int y)
{
    std::cout << "Adding Integers....";
    return (x+y);
}

int main()
{
    std::cout << "What is 500 + 600?";
    std::cout << "The Sum is " << add(500, 600) << "\n\n";
    std::cout << "What is 900 + 100?";
    std::cout << "The sum is " << add(700, 800) << "\n\n";
    return 0;
}
#6. Posted:
JackM97
  • Prospect
Status: Offline
Joined: Jan 30, 201113Year Member
Posts: 638
Reputation Power: 25
Status: Offline
Joined: Jan 30, 201113Year Member
Posts: 638
Reputation Power: 25
SillyPanda wrote
Not sure if this is what you want just wrote it real quick if you want to change it around making it division,multiplication,etc. Hope I helped somewhat.


#include <iostream>

int add(int x,int y)
{
    std::cout << "Adding Integers....";
    return (x+y);
}

int main()
{
    std::cout << "What is 500 + 600?";
    std::cout << "The Sum is " << add(500, 600) << "\n\n";
    std::cout << "What is 900 + 100?";
    std::cout << "The sum is " << add(700, 800) << "\n\n";
    return 0;
}



C++? He asked for C#.
using System;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            EnterInt:
            int int1 = 0, int2 = 0, int3 = 0;
            try
            {
                Console.WriteLine("Enter interger one:");
                int1 = int.Parse(Console.ReadLine());
                Console.WriteLine("You entered {0} as your first interger. What would you like your second interger to be?", int1);
                int2 = int.Parse(Console.ReadLine());
                Console.WriteLine("So {0} and {0}...", int1, int2);
            }
            catch (Exception e)
            {
                Console.WriteLine("Try again! Remember, Intergers only!");
                goto EnterInt;
            }
            Console.WriteLine("Int 1 * Int 2 = {0}", int1*int2);
            Console.WriteLine("Int 1 + Int 2 = {0}", int1+int2);
            Console.WriteLine("Int 1 / Int 2 = {0}", int1/int2);
            Console.WriteLine("Int 2 / Int 1 = {0}", int2/int1);
            Console.WriteLine("Int 1 - Int 2 = {0}", int1-int2);
            Console.WriteLine("Int 2 - Int 1 = {0}", int2-int1);
        }
    }
}


Hope that helped. Feel free to ask for anything else.
#7. Posted:
Boolean
  • TTG Senior
Status: Offline
Joined: Jan 04, 201113Year Member
Posts: 1,732
Reputation Power: 72
Status: Offline
Joined: Jan 04, 201113Year Member
Posts: 1,732
Reputation Power: 72
JackM97 wrote
SillyPanda wrote
Not sure if this is what you want just wrote it real quick if you want to change it around making it division,multiplication,etc. Hope I helped somewhat.


#include <iostream>

int add(int x,int y)
{
    std::cout << "Adding Integers....";
    return (x+y);
}

int main()
{
    std::cout << "What is 500 + 600?";
    std::cout << "The Sum is " << add(500, 600) << "\n\n";
    std::cout << "What is 900 + 100?";
    std::cout << "The sum is " << add(700, 800) << "\n\n";
    return 0;
}



C++? He asked for C#.
using System;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            EnterInt:
            int int1 = 0, int2 = 0, int3 = 0;
            try
            {
                Console.WriteLine("Enter interger one:");
                int1 = int.Parse(Console.ReadLine());
                Console.WriteLine("You entered {0} as your first interger. What would you like your second interger to be?", int1);
                int2 = int.Parse(Console.ReadLine());
                Console.WriteLine("So {0} and {0}...", int1, int2);
            }
            catch (Exception e)
            {
                Console.WriteLine("Try again! Remember, Intergers only!");
                goto EnterInt;
            }
            Console.WriteLine("Int 1 * Int 2 = {0}", int1*int2);
            Console.WriteLine("Int 1 + Int 2 = {0}", int1+int2);
            Console.WriteLine("Int 1 / Int 2 = {0}", int1/int2);
            Console.WriteLine("Int 2 / Int 1 = {0}", int2/int1);
            Console.WriteLine("Int 1 - Int 2 = {0}", int1-int2);
            Console.WriteLine("Int 2 - Int 1 = {0}", int2-int1);
        }
    }
}


Hope that helped. Feel free to ask for anything else.

Oh!,Sorry man read the topic wrong.....
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.