cs50/src1/calculator1.c

25 lines
300 B
C

// Scope error
#include <cs50.h>
#include <stdio.h>
int add(void);
int main(void)
{
// Prompt user for x
int x = get_int("x: ");
// Prompt user for y
int y = get_int("y: ");
// Perform addition
int z = add();
printf("%i\n", z);
}
int add(void)
{
return x + y;
}