File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 232
232
// ============================================================
233
233
234
234
// // ============================================================
235
- // 📌 Factorial Finder
235
+ // 📌 Factorial Finder
236
236
// 👉👉 🔹 Q- 7: একটি ফাংশন লিখো যা একটি সংখ্যা ইনপুট নিয়ে তার Factorial বের করবে।
237
237
// ============================================================
238
238
239
239
240
+
241
+
242
+ #include <stdio.h>
243
+ int factorial (int n );
244
+ int main (){
245
+ int n ;
246
+ printf ("Enter Number " ) ;
247
+ scanf ("%d" , & n );
248
+ int fac = factorial (n );
249
+ printf ("factorial is %d\n" , fac );
250
+
251
+ return 0 ;
252
+ }
253
+
254
+ int factorial (int n ){
255
+ int result = 1 ;
256
+ for (int i = 1 ; i <=n ; i ++ ){
257
+ result = i * i ;
258
+ }
259
+ return result ;
260
+
261
+ }
262
+
263
+
264
+
240
265
// #include <stdio.h>
241
266
// int main(){
242
267
You can’t perform that action at this time.
0 commit comments