Skip to content

Commit 811f08f

Browse files
committed
Added double example to printingVariables.c
1 parent 9daaa69 commit 811f08f

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

a.out

8.23 KB
Binary file not shown.

printingVariables.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ int main()
44
{
55
int num1;
66
int num2;
7+
double doubleNum;
78
char firstInitial;
89
char secondInitial;
910

1011
num1 = 4;
1112
num2 = 9;
13+
doubleNum = 6.6;
1214
firstInitial = 'C';
1315
secondInitial = 'K';
1416

1517
printf("The first number is %d and the second number is %d\n",num1,num2);
18+
printf("You can print numbers with decimals like %.1lf using the double data type\n",doubleNum);
1619
printf("My initials are %c.%c\n",firstInitial,secondInitial);
1720

1821
return 0;

simpleCalculations.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <stdio.h>
2+
3+
int main()
4+
{
5+
6+
int num1;
7+
int num2;
8+
9+
num1 = 20;
10+
num2 = 5;
11+
12+
13+
14+
15+
return 0;
16+
}

0 commit comments

Comments
 (0)