অ্যালগরিদমঃ
(১) প্রোগ্রাম শুরু।
(২) ইনপুট হিসাবে n এর মাধ্যমে গ্রহণ।
(৩) ধরি s = 0, c = 1
(৪) ধরি s = s + c
(৫) ধরি c = c + 1
(৬) তুলনাঃ c এর মান কি n এর চেয়ে বড়?
(ক) যদি না হয় তবে ৪ নং ধাপে গমন।
(খ) যদি হ্যাঁ হয় তবে ৭ নং ধাপে গমন।
(৭) ফলাফল s এর মাধ্যমে প্রদর্শন।
(৮) প্রোগ্রাম শেষ।
ফ্লোচার্টঃ
প্রোগ্রামঃ
#include<stduo.h> #include<conio.h> main () { clrscr(); int s, n, c; printf("Enter the value of n is :"); scanf(“%d”, &n); s=0; for(c=1; c<=n; c++) s = s + c; printf("The result is : %d", s); getch(); }
এর আউটপুট হলোঃ
বিঃ দ্রঃ ভালো লাগলে অবশ্যই শেয়ার করতে হবে।
Nice post. You can get more code here. HSC ICT Programming Code for Practical
ReplyDeleteClick to see the code!
To insert emoticon you must added at least one space before the code.