Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Globalandlocal
1.
2.
3.
4. program Factorprog;
Uses crt;
Var No: integer;
Function Factor(N:integer): integer;
Var
F,I: integer;
Begin
F:=1;
For I:=N down to 1 do
F:= F*I;
Factor:=F;
End;
Begin
Clrscr;
Writeln(‘Enter a number:’);
Readln(No);
Writeln(‘The Factorial Value:’, Factor(No));
Readln;
End.
5.
6.
7. program Factorprog; Begin
Uses 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;
Repeat
P:=P*B
I:= I-1;
Until (I=0);
Power:=P;
End;