Skip to content

Commit 815c176

Browse files
committed
format
1 parent 76eb21f commit 815c176

File tree

2 files changed

+21
-40
lines changed

2 files changed

+21
-40
lines changed

a.out

0 Bytes
Binary file not shown.

solve_problem.c

Lines changed: 21 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
// return 0;
6060
// }
6161

62-
6362
// #include <stdio.h>
6463
// #include <math.h>
6564

@@ -85,24 +84,18 @@
8584
// float rectangle_f(float a , float b){
8685
// return a*b ;
8786
// }
88-
// ===================================== // ======================
89-
90-
87+
// ===================================== // ======================
9188

9289
// ============================================================
9390
// 📌 Practice Problems
9491
// Topic : C Programming - Functions
95-
// Level : 1 – Basic Function Problems
92+
// Level : 1 – Basic Function Problems
9693
// ============================================================
9794

98-
9995
// ============================================================
10096
// 👉👉 🔹 Q-4: একটি ফাংশন লিখো যা একটি পূর্ণসংখ্যা ইনপুট নিয়ে তার স্কয়ার রিটার্ন করবে।
10197
// ============================================================
10298

103-
104-
105-
10699
// #include <stdio.h>
107100
// int square (int n);
108101
// int main(){
@@ -117,8 +110,6 @@
117110
// return n*n ;
118111
// }
119112

120-
121-
122113
// ============================================================
123114
// 👉👉 🔹 Q-: একটি ফাংশন লিখো যা একটি পূর্ণসংখ্যা ইনপুট নিয়ে তার স্কয়ার রিটার্ন করবে।
124115
// ============================================================
@@ -129,16 +120,14 @@
129120
// printf("Enter Number : ");
130121
// scanf("%d" , &n);
131122
// int result = input_square(n);
132-
// printf("Square number is : %d\n", result) ;
123+
// printf("Square number is : %d\n", result) ;
133124
// return 0;
134125
// }
135126

136127
// int input_square(int n){
137128
// return n*n ;
138129
// }
139130

140-
141-
142131
// ============================================================
143132
// 👉👉 🔹 Q- 5: একটি ফাংশন লিখো যা একটি পূর্ণসংখ্যা ইনপুট নিয়ে বলে দেবে সংখ্যাটি জোড় না বিজোড়।
144133
// ============================================================
@@ -161,12 +150,11 @@
161150
// }else{
162151
// printf("%d is Odd.\n " , n) ;
163152
// }
164-
165-
// }
166153

154+
// }
167155

168156
// ===========================================================
169-
// 📌 Review Solve
157+
// 📌 Review Solve
170158
// 👉👉 🔹 Q- 5: একটি ফাংশন লিখো যা একটি পূর্ণসংখ্যা ইনপুট নিয়ে বলে দেবে সংখ্যাটি জোড় না বিজোড়।
171159
// ============================================================
172160

@@ -187,17 +175,14 @@
187175
// }else{
188176
// printf("%d is Odd.\n" , n);
189177
// }
190-
191-
192-
// }
193178

179+
// }
194180

195181
// ============================================================
196182
// 📌 Sum of Two Numbers
197183
// 👉👉 🔹 Q- 6: দুটি সংখ্যার যোগফল বের করার জন্য একটি ফাংশন লিখো।
198184
// ============================================================
199185

200-
201186
// #include <stdio.h>
202187
// int sum(int y, int z);
203188

@@ -209,7 +194,6 @@
209194
// int result = sum(y,z) ;
210195
// printf("Result is : %d\n", result);
211196

212-
213197
// return 0;
214198

215199
// }
@@ -219,7 +203,7 @@
219203
// ============================================================
220204
// 📌 Sum of Two Numbers
221205
// 👉👉 🔹 Q- 6.2: দুটি সংখ্যার যোগফল বের করার জন্য একটি ফাংশন লিখো।
222-
// 👉 🔹 Version :2.0
206+
// 👉 🔹 Version :2.0
223207
// ============================================================
224208
// #include <stdio.h>
225209
// int sum(int a , int b);
@@ -231,7 +215,6 @@
231215
// printf("Enter second Numbers : ");
232216
// scanf("%d", &b);
233217

234-
235218
// int total= sum(a,b);
236219
// printf("Sum is : %d\n", total);
237220

@@ -242,42 +225,40 @@
242225
// return a + b ;
243226
// }
244227

245-
246228
// ============================================================
247229
// 📌 Practice Problems
248230
// Topic : C Programming - Functions
249-
// Level 2 – Intermediate Function Problems
231+
// Level 2 – Intermediate Function Problems
250232
// ============================================================
251233

252-
253-
254234
// // ============================================================
255235
// 📌 Factorial Finder
256-
// 👉👉 🔹 Q- 6: একটি ফাংশন লিখো যা একটি সংখ্যা ইনপুট নিয়ে তার Factorial বের করবে।
236+
// 👉👉 🔹 Q- 7: একটি ফাংশন লিখো যা একটি সংখ্যা ইনপুট নিয়ে তার Factorial বের করবে।
257237
// ============================================================
258238

259-
260239
#include <stdio.h>
261240
int factorial(int n);
262-
int main(){
241+
int main()
242+
{
263243
int n;
264244
printf("Enter Number : ");
265-
scanf("%d" , &n);
266-
int result = factorial(n) ;
267-
int fac = 1 ;
268-
for(int i = 1 ; i<=n ;i++){
269-
fac = i*result;
270-
printf("FActorial is : %d\n" , result) ;
245+
scanf("%d", &n);
246+
int result = factorial(n);
247+
int fac = 1;
248+
for (int i = 1; i <= n; i++)
249+
{
250+
fac = i * fac;
251+
printf("Factorial is : %d\n", result);
271252
}
272253

273254
return 0;
274255
}
275256

276-
int factorial(int n){
277-
return n ;
257+
int factorial(int n)
258+
{
259+
return n;
278260
}
279261

280-
281262
// #include <stdio.h>
282263
// int main(){
283264

0 commit comments

Comments
 (0)