24 lines
326 B
C
24 lines
326 B
C
// Eliminates unnecessary variables
|
|
|
|
#include <cs50.h>
|
|
#include <stdio.h>
|
|
|
|
int add(int a, int b);
|
|
|
|
int main(void)
|
|
{
|
|
// Prompt user for x
|
|
int x = get_int("x: ");
|
|
|
|
// Prompt user for y
|
|
int y = get_int("y: ");
|
|
|
|
// Perform addition
|
|
printf("%i\n", add(x, y));
|
|
}
|
|
|
|
int add(int a, int b)
|
|
{
|
|
return a + b;
|
|
}
|