Skip to main content

Summing Of N numbers in GW basic Program

10 print "Enter value of N"
20 input n
30 let s=0
40 let i=0
45 read a
50 let s=s+a
60 let z=0
65 i=i+1
70 if i< n then 45
80 print "Sum is = ";s "N=";n
90 Data 5,9,6,8,7,11,1,3,4,6
100 End


--------------------------------------------Out Put---------------------------------------------------------

Enter value of N
? 10
Sum is 60 n = 10

To Join My Face Book Page Please click here

https://www.facebook.com/Sova-Computer-1525574537698586/

Comments

Popular posts from this blog

Class x_ Blue j java question solve(Important)

Section – A Answer any four of the following : 1 . Write a Program to calculate charges for sending particles when the charges are as follows For the first 1KG  Rs.15.00  , For additional weight , for every 500gm or fraction thereof: Rs 8.00 Ans class Prog1 { static void test(double wt)//user enters the weight in KGs { System.out.println(“Parcel  Weight is “+wt); int icharge = 15; System.out.println(“Initial  charge is “+icharge); int rwt = (int)((wt-1)*1000); System.out.println(“Remaining  weight after deducing 1Kg “+rwt); int rcharge = (rwt/500)*8; System.out.println(“Charge  excluding fractional part is Rs.”+(icharge+rcharge)); int fcharge = (rwt%500>0)?8:0; System.out.println(“Charge  for fractional part is Rs. “+fcharge); int tcharge = icharge+rcharge+fcharge; System.out.println(“Total  Charge is Rs. “+tcharge); } } 2 . A special two-digit number is such that when the sum of its digits is added to the product of its digits , the res...