|
1 |
| -// #include <stdio.h> |
| 1 | +#include <stdio.h> |
2 | 2 | // declaration
|
3 |
| -// void helloPrint(); |
| 3 | +void helloPrint(); |
4 | 4 |
|
5 | 5 |
|
6 |
| -// int main(){ |
7 |
| -// helloPrint() ; // function call |
8 |
| -// return 0; |
9 |
| -// } |
| 6 | +int main(){ |
| 7 | + helloPrint() ; // function call |
| 8 | + return 0; |
| 9 | +} |
10 | 10 |
|
11 | 11 | // Function Dafination
|
12 |
| -// void helloPrint(){ |
13 |
| -// printf("Hello - World\n"); |
14 |
| -// } |
| 12 | +void helloPrint(){ |
| 13 | + printf("Hello - World\n"); |
| 14 | +} |
15 | 15 |
|
16 | 16 |
|
17 | 17 |
|
18 | 18 |
|
19 | 19 |
|
20 |
| -// #include <stdio.h> |
21 |
| -// void printHello(); |
22 |
| -// int main(){ |
23 |
| -// printHello(); |
24 |
| -// printHello(); |
25 |
| -// printHello(); |
| 20 | +#include <stdio.h> |
| 21 | +void printHello(); |
| 22 | +int main(){ |
| 23 | + printHello(); |
| 24 | + printHello(); |
| 25 | + printHello(); |
26 | 26 |
|
27 |
| -// return 0; |
28 |
| -// } |
29 |
| -// void printHello(){ |
30 |
| -// printf("Hello ! \n"); |
31 |
| -// printf("Learn'C' Programming Language \n") ; |
32 |
| -// } |
| 27 | + return 0; |
| 28 | +} |
| 29 | +void printHello(){ |
| 30 | + printf("Hello ! \n"); |
| 31 | + printf("Learn'C' Programming Language \n") ; |
| 32 | +} |
33 | 33 |
|
34 | 34 |
|
35 | 35 |
|
|
38 | 38 |
|
39 | 39 | // ===================================================
|
40 | 40 |
|
41 |
| -// #include <stdio.h> |
42 |
| -// int sum(int a , int b); |
43 |
| -// int main(){ |
44 |
| -// int a,b ; |
45 |
| -// printf("Enter First Number :"); |
46 |
| -// scanf("%d" , &a); |
47 |
| -// printf("Enter Second Number : "); |
48 |
| -// scanf("%d" , &b); |
49 |
| -// int result = sum(a,b);// Argument / Actual parameter |
50 |
| -// printf("%d\n", result) ; |
51 |
| -// return 0; |
52 |
| -// } |
| 41 | +#include <stdio.h> |
| 42 | +int sum(int a , int b); |
| 43 | +int main(){ |
| 44 | +int a,b ; |
| 45 | +printf("Enter First Number :"); |
| 46 | +scanf("%d" , &a); |
| 47 | +printf("Enter Second Number : "); |
| 48 | +scanf("%d" , &b); |
| 49 | +int result = sum(a,b);// Argument / Actual parameter |
| 50 | +printf("%d\n", result) ; |
| 51 | + return 0; |
| 52 | +} |
53 | 53 |
|
54 |
| -// int sum(int x , int y){ // parameter / formal parameter |
| 54 | +int sum(int x , int y){ // parameter / formal parameter |
55 | 55 |
|
56 |
| -// return x+y ; |
57 |
| -// } |
| 56 | + return x+y ; |
| 57 | +} |
58 | 58 |
|
59 | 59 |
|
60 | 60 |
|
61 | 61 |
|
62 |
| -// #include <stdio.h> |
63 |
| -// void printTable(int n); |
64 |
| -// int main(){ |
65 |
| -// int n; |
66 |
| -// printf("Enter Number :"); |
67 |
| -// scanf("%d",&n); |
| 62 | +#include <stdio.h> |
| 63 | +void printTable(int n); |
| 64 | +int main(){ |
| 65 | + int n; |
| 66 | + printf("Enter Number :"); |
| 67 | + scanf("%d",&n); |
68 | 68 |
|
69 |
| -// printTable(n); //argument / actual parameter |
70 |
| -// return 0; |
71 |
| -// } |
| 69 | + printTable(n); //argument / actual parameter |
| 70 | + return 0; |
| 71 | +} |
72 | 72 |
|
73 |
| -// void printTable(int n){ // actual parameter / formal parameter |
74 |
| -// for(int i = 1 ; i <= 10 ; i++){ |
75 |
| -// printf("%d\n", i*n); |
76 |
| -// } |
77 |
| -// } |
| 73 | +void printTable(int n){ // actual parameter / formal parameter |
| 74 | + for(int i = 1 ; i <= 10 ; i++){ |
| 75 | + printf("%d\n", i*n); |
| 76 | + } |
| 77 | +} |
78 | 78 |
|
79 | 79 |
|
80 | 80 |
|
81 | 81 |
|
82 | 82 |
|
83 |
| -// #include <stdio.h> |
84 |
| -// void calculatePrice(float value); |
85 |
| -// int main(){ |
86 |
| -// float value = 100.0; |
87 |
| -// calculatePrice(value); |
88 |
| -// return 0; |
89 |
| -// } |
| 83 | +#include <stdio.h> |
| 84 | +void calculatePrice(float value); |
| 85 | +int main(){ |
| 86 | + float value = 100.0; |
| 87 | + calculatePrice(value); |
| 88 | + return 0; |
| 89 | +} |
90 | 90 |
|
91 |
| -// void calculatePrice(float value){ |
92 |
| -// value = value + (0.18 * value); |
93 |
| -// printf("total price : %f" , value); |
94 |
| -// } |
| 91 | +void calculatePrice(float value){ |
| 92 | + value = value + (0.18 * value); |
| 93 | + printf("total price : %f" , value); |
| 94 | +} |
95 | 95 |
|
96 | 96 | // =======================================
|
97 | 97 |
|
98 |
| -// #include <stdio.h> |
| 98 | +#include <stdio.h> |
99 | 99 |
|
100 |
| -// void calculate_Price(float value); |
101 |
| -// int main(){ |
| 100 | + void calculate_Price(float value); |
| 101 | +int main(){ |
102 | 102 |
|
103 |
| -// float value = 100.0 ; |
104 |
| -// calculate_Price( value); |
105 |
| -// return 0; |
106 |
| -// } |
107 |
| - |
108 |
| -// void calculate_Price(float value){ |
109 |
| -// value = value + (0.18 * value) ; |
110 |
| -// printf("Final Value : %d\n " , value); |
111 |
| -// } |
112 |
| - |
113 |
| -// comment out |
114 |
| - |
115 |
| -// #include <stdio.h> |
116 |
| -// int main(){ |
117 |
| - |
118 |
| -// return 0; |
119 |
| -// } |
| 103 | + float value = 100.0 ; |
| 104 | + calculate_Price( value); |
| 105 | + return 0; |
| 106 | +} |
| 107 | + |
| 108 | +void calculate_Price(float value){ |
| 109 | + value = value + (0.18 * value) ; |
| 110 | + printf("Final Value : %d\n " , value); |
| 111 | +} |
0 commit comments