Skip to content

Instantly share code, notes, and snippets.

View jasonjwells's full-sized avatar

Jason John Wells jasonjwells

View GitHub Profile
@jasonjwells
jasonjwells / ifStatements.c
Created October 22, 2013 17:15
How get input and defend against user errors.
#include <stdio.h>
int main(void)
{
int favColour;
char name[20];
double speed;
printf("What is your name?\n");
scanf("%s", name);
printf("What is your favourite colour? (press 1 for red, 2 for blue)\n");