top of page

Welcome back for some programming!

Writer: Amulya Malapaka
Amulya Malapaka
Jun 23, 2018
1 min read

Last week we began with the simple hello world beginner stuff. Let's get a little more crazy. Today, I would like to see some math! Write a program with a function that adds two numbers. For example, if I use your function, and use 2 and 3 as the parameters, your function should return 5.


To go with this problem, here is another tea recipe!

https://www.allrecipes.com/recipe/247052/spiced-thai-iced-tea/?internalSource=staff%20pick&referringId=139&referringContentType=recipe%20hub

Visit this website for sum (yes pun very much intended) awesome thai iced tea to help you get through the summer with working brain cells. Respond to my post and get as created or as advanced as you would like! Remember, we are all here to learn!


Yours truly,


Amulya

 
 
 

Recent Posts

See All
Well it's been a while, huh.

Welcome back girls and boys, we're in for a fun ride :) As the end of the school year approaches us I'm sure we're excited for a summer...

 
 
 
THANKSGIVING!

IT'S THANKSGIVING!!! Want to know what I'm thankful for? I'm thankful for the beautiful weather we've been having.(Yes that was...

 
 
 

4 Comments


lubeck1089
lubeck1089
Nov 05, 2018

public String add(int a, int b)

{

int sum = a + b;

String output = "Hey, guess what!!! " + a + " + " + b + " = " sum + "!!!";

}

public static void main(String args[])

{

String math = add(2,3);

System.out.println(math);

}

Like

Manasi Mangalvedhe
Manasi Mangalvedhe
Sep 24, 2018

In C++, it would be:


int addition (int 2, int 3)

{

int r;

r=a+b;

return r;

}


int main ()

{

int 8;

z = addition (2,3);

cout << "The result is " << z;

}

Like

Christina Hu
Christina Hu
Sep 24, 2018

function sum(a,b)

{

int sum = 0;

sum = a+b;

return sum;

}


sum(2,3);


Like

Meher Malapaka
Meher Malapaka
Jun 26, 2018

in Java


import java.util.Scanner;

class sumNumbers

{

public static void main(String [] args)

{

int a,b,c;

System.out.println ("Enter two numbers:");

Scanner in = new Scanner (System.in);

a = in.nextInt();

b = in.nextInt();

c = a + b;

System.out.println ("Sum = "+ c);

}

}

Like
bottom of page