17 lines
276 B
C
17 lines
276 B
C
// Division with ints, demonstrating truncation
|
|
|
|
#include <cs50.h>
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
// Prompt user for x
|
|
int x = get_int("What's x? ");
|
|
|
|
// Prompt user for y
|
|
int y = get_int("What's y? ");
|
|
|
|
// Divide x by y
|
|
printf("%i\n", x / y);
|
|
}
|