Created
February 13, 2024 00:09
-
-
Save jmichalenko/552bc5c3a19c6dc0b6313f939d026a42 to your computer and use it in GitHub Desktop.
CS50 Labs Operator Starter Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cs50.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
// declare an int variable a and get user input | |
int a = get_int("Enter a whole number: "); | |
// declare an int b and assign it the value of a plus 3 | |
// declare an int c and assign it the value of a times 5 | |
// declare an int d and set it to a divided by 4 | |
// declare an int e and assign it to the remainder after dividing a by 4 | |
// declare a float f and set it to a divided by 4.0 | |
// printing the results | |
printf("\n"); | |
printf("a plus 3 is %i\n", b); | |
printf("a times 5 is %i\n", c); | |
printf("a divided by 4 is %i\n", d); | |
printf("a mod 4 is %i\n", e); | |
printf("a divided by 4.0 is really %f\n", f); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment