Globalandlocal

448 views

Published on

Notes sa computer :)

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
448
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Globalandlocal

  1. 1. program Factorprog;Uses crt;Var No: integer;Function Factor(N:integer): integer;Var F,I: integer;BeginF:=1;For I:=N down to 1 doF:= F*I;Factor:=F;End;BeginClrscr;Writeln(‘Enter a number:’);Readln(No);Writeln(‘The Factorial Value:’, Factor(No));Readln;End.
  2. 2. program Factorprog; BeginUses crt; Clrscr;Var Writeln(‘Enter base number:’); Base, Expo: integer; Readln(Base);Function Power (B: integer; E: writeln(‘Enter exponent number:’);integer) : integer; Readln(Expo);Var Writeln(‘Power Value:’, P: integer; Power(Base, Expo)); I: integer; Readln;Begin End.P:= 1;I:= E;RepeatP:=P*BI:= I-1;Until (I=0);Power:=P;End;

×