DECLARE FUNCTION AVERAGE (A, B, C)
CLS
INPUT “ENTER FIRST NUMBER”; A
INPUT “ENTER SECOND NUMBER”; B
INPUT “ENTER THIRD NUMBER”; C
PRINT “AVERAGE OF THREE NUMBERS”; AVERAGE (A, B, C)
FUNCTION AVERAGE (A, B, C)
AVERAGE = (A + B + C) / 3
END FUNCTION
Using sub procedure
ReplyDeleteThis comment has been removed by the author.
DeleteDECLARE SUB Average(a,b,c)
DeleteCLS
INPUT"Enter first number";a
INPUT"Enter second number";b
INPUT"Enter third number";c
CALL SUB Average(a,b,c)
END
SUB Average(a,b,c)
Avg=(a+b+c)/3
PRINT"Average of three numbers=";Avg
END SUB
Fuck you mother fucker
Deletethis question came in my exam also..
Deleteit help to do my homework also
ReplyDeleteHorw
DeleteKindly enter values for the variables given
ReplyDeletefuck
ReplyDeleteCLS
ReplyDeleteINPUT "enter a number"; A
INPUT "enter a number"; B
INPUT "enter a number"; C
INPUT "enter a number"; D
INPUT "enter a number"; E
Avg = (A + B + C + D + E / 5)
PRINT "Average is"; Avg
END
This language is easier
Damm easy as F
ReplyDeleteTor
ReplyDeleteIs there any method to input the 10 numbers at once without typing the input statement so many times
ReplyDeleteUse Array
Deleteinput"enter numbers";a,b,c,d,e,f.........
ReplyDeleteyou can enter as much as you can..
CLS
ReplyDeleteINPUT"Enter the first number;"a
INPUT"Enter the second number;"b
INPUT"Enter the third number;"c
INPUT"Enter the fourth number;'d
INPUT"Enter the fifth number;"e
Avg=a+b+c+d+e
PRINT"The average sum of five number is;"Avg
END
thx for the answer
ReplyDeleteCan u give me app name
ReplyDeleteHow do you do it with both defined function and sub procedure? Like asking three numbers and finding average by function method and calculating product by sub method, in the same program?
ReplyDeleteGreat post. Thank you for sharing
ReplyDeleteWeb Development Company in Kochi