Skip to content

Commit 0247db6

Browse files
committed
added files for video 5, 6 and 7
1 parent 3ba5ba5 commit 0247db6

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

C_Begineer/04-CBeginner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <stdlib.h>
33

44
int main() {
5-
5+
66
printf("Bucky is awesome \n");
77
printf("Bucky is cool \a");
88
return 0;

C_Begineer/05-CBegineer.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
4+
int main() {
5+
6+
//This is single line
7+
printf("Bucky is awesome \n");
8+
printf("Bucky is cool \a");
9+
return 0;
10+
11+
}

C_Begineer/06-CBegineer.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
4+
int main() {
5+
6+
//will replace %s with bucky
7+
printf("%s is best person ever \n", "Bucky");
8+
9+
//will replace %d with 9
10+
printf("I ate %d corndogs last night \n", 9);
11+
12+
//will replace %f with 3.14159
13+
printf("Value of pi is %f \n", 3.14159);
14+
15+
//will replace %f with 3.14 (2 decimal)
16+
printf("Value of pi is %.2f \n", 3.14159);
17+
18+
//will replace %f with 3.14159 (3 decimal
19+
printf("Value of pi is %.3f \n", 3.14159);
20+
21+
return 0;
22+
}

C_Begineer/07-CBegineer.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
4+
int main() {
5+
6+
int age;
7+
int currentYear;
8+
int birthYear;
9+
10+
currentYear = 2014;
11+
birthYear = 1987;
12+
age = (currentYear - birthYear);
13+
14+
printf("Bucky is %d years old \n", age);
15+
16+
return 0;
17+
}

0 commit comments

Comments
 (0)