This file contains hidden or 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
alert('test'); |
This file contains hidden or 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 <stdio.h> | |
int main() { | |
int age; | |
int sum = 0; | |
float avrg; | |
int x; | |
printf("I'm going to ask 10 people for their age and then find the average\n"); | |
printf("of their ages at the end, just for fun!\n\n"); |
This file contains hidden or 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 <stdio.h> | |
int main(void) { // Thanks to @barrettcolin for showing me the way. | |
int age; | |
printf("What is your age? "); | |
scanf("%d", &age); // Accept a numeric input and push it to age (by getting the lvalue of age) | |
if(age < 5) { | |
printf("Wow, you're very young!\n"); | |
} else if(age < 12) { |
NewerOlder