Skip to content

Commit 8f9ce1a

Browse files
demonstrate variables further (#7)
1 parent a71c82c commit 8f9ce1a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

2_variables.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#include <stdio.h>
22

3-
int main ()
4-
{
5-
int myNum = 10;
6-
printf("%d",myNum);
7-
return 0;
3+
int main() {
4+
// Create variables
5+
int myNum = 15; // Integer (whole number)
6+
float myFloatNum = 5.99; // Floating point number
7+
char myLetter = 'D'; // Character
8+
9+
// Print variables
10+
printf("%d\n", myNum);
11+
printf("%f\n", myFloatNum);
12+
printf("%c\n", myLetter);
13+
return 0;
814
}

2_variables.exe

323 KB
Binary file not shown.

0 commit comments

Comments
 (0)