Definition: Algorithm kisi particular problem ko solve karne ka method hai. Isko step by step write kiya jata hai. Algorithm me Instructions se hame ye pata chalta hai ki hamara Task kya hai aur isko kaise complete/exit karege.
Some Rules For Write Algorithms 1. Instruction ko clearly likhna chahiye, means ye padhne par asaani se samajh me aa jay. 2. Accha hoga ager Algorithm jyada lengthy na ho. Example 1:Write an Algorithm which add any two given number A and B. Step 1. Read any Two number A and B Step 2. Add the value of A and B and store the result in C (as C=A+B) Step 3. Print the result C Step 4. Exit
Pehle step me bataya gya hai ki A aur B ko read kare, means A aur B me value kya hai. Maan lo A ki value 10 hai aur B ki value 20 hai. Dusre step me bataya gya hai A and B ko Add karke Result ko C me store karna hai, C=A+B Step 3 me Result ko Print karega (10+20=30 C means result 30 hoga) Step 4 Exit means Task Complete ho gya Example 2 Write an Algorithm to Calculate Simple Interest. Step 1. Read P,T and R Step 2. Calculate SI=P*R*T/100 Step 3. Print SI Step 4. Exit
2 Comments
Vry nice bro. How create new C Program, Wht is Software new create program tall me
ReplyDeleteThanks.
DeleteTurbo C best software hai, aur first program kaise banaye iske liye hum jald hi post likhe ge.