our new ventures

Dear friends we are posting latest papers and material on https://go4exams.com do not forget to subscribe to funny new whattsapp channel at https://whatsapp.com/channel/0029VayGFCf3QxS5oTgCDU2d

Wednesday, May 23, 2012

A Computer program is an algorithm. Explain? Write an algorithm to find the sum of N even numbers

A Computer program is an algorithm. Explain? Write an algorithm to find the sum of N even numbers

Algorithm is a prescribed set of well-defined, unambiguous rules or processes for the solution of a problem in a finite number of steps.
Computer programs are also a set of well defined instructions to solve any type of problems in definite language.
STEP 1 Input Total Numbers
Initialize Counter
Initialize Number
 Initialize Sum

STEP 2 Input First Number
Add the Number to Sum
 Increase The Counter
Check counter = total numbers
If counter < Total Numbers Repeat

 Step 2 If counter Total Numbers then stop

No comments:

Post a Comment

Join Our WhatsApp Channel for Non-Stop Memes & Quotes!

  Join Our WhatsApp Channel for Non-Stop Memes & Quotes! Hey 👋 Feeling stressed? Need a quick laugh? We’ve got just the thing for...