// Let's do some varibles and see how to assign them #include // define constants outside of the main #define PI 3.14 int main(void){ // Declare a variable of type int // First state what type of variable - int, double or char double number; number = 6; // If I want to print out a value that is inside a variable, // i will use a format specifier ---- %d (int) printf("The variable number is %lf \n", number); // Now I can actually do this in one line // Declred and initialised in one line double number_two = 4; printf("The second variable number_two is %lf\n", number_two); //int answer = number * number_two; printf("The division of %lf and %lf is %lf\n", number, number_two, number / number_two); //printf("The variable number is %d, number_two is %d\n", number, number_two); // Declare a char and initialise it char character = 's'; printf("The variable character is %d\n", character); printf("The character is %c\n", character + 2); /* // Declare a decimal value // double decimal = 3.14; printf("The decimal is %.2lf\n", decimal); // Let's scan something in from the terminal // function that will scan in from terminal is called scanf() int answer; int answer_two; printf("Type in two numbers to scn in: "); scanf("%d %d", &answer, &answer_two); printf("The numbers scanned in: %d, %d\n", answer, answer_two); double decimal_answer; printf("Type in a deimal to scan: "); scanf("%lf", &decimal_answer); printf("Decimal_answer %lf\n", decimal_answer); char character_answer; scanf(" %c", &character_answer); printf("The character is %c\n", character_answer); */ return 0; }