SlideShare ist ein Scribd-Unternehmen logo
1 von 8
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.
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;
Globalandlocal

Weitere ähnliche Inhalte

Was ist angesagt?

Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
alish sha
 

Was ist angesagt? (19)

Stack and queue -polish notations
Stack and queue -polish notationsStack and queue -polish notations
Stack and queue -polish notations
 
Stack application
Stack applicationStack application
Stack application
 
How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program
 
Programming questions
Programming questionsProgramming questions
Programming questions
 
Compiler design lab programs
Compiler design lab programs Compiler design lab programs
Compiler design lab programs
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design lab
 
Arithmetic and Arithmetic assignment operators
Arithmetic and Arithmetic assignment operatorsArithmetic and Arithmetic assignment operators
Arithmetic and Arithmetic assignment operators
 
1 c introduction
1 c introduction1 c introduction
1 c introduction
 
Presentatie
PresentatiePresentatie
Presentatie
 
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)
Operator  C# - Lec3 (Workshop on C# Programming: Learn to Build)Operator  C# - Lec3 (Workshop on C# Programming: Learn to Build)
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)
 
PL /SQL program UNIT 5 DMS 22319
PL /SQL program UNIT 5 DMS 22319PL /SQL program UNIT 5 DMS 22319
PL /SQL program UNIT 5 DMS 22319
 
Labreportofai
LabreportofaiLabreportofai
Labreportofai
 
Conversion of Infix To Postfix Expressions
Conversion of Infix To Postfix Expressions Conversion of Infix To Postfix Expressions
Conversion of Infix To Postfix Expressions
 
Program to find factorial of a number
Program to find factorial of a numberProgram to find factorial of a number
Program to find factorial of a number
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
My first program in c, hello world !
My first program in c, hello world !My first program in c, hello world !
My first program in c, hello world !
 
Write a program to implement the stack algorithm ? 1. Initialize an empty sta...
Write a program to implement the stack algorithm ? 1. Initialize an empty sta...Write a program to implement the stack algorithm ? 1. Initialize an empty sta...
Write a program to implement the stack algorithm ? 1. Initialize an empty sta...
 
Earned value management
Earned value managementEarned value management
Earned value management
 
Pointcloud sample
Pointcloud samplePointcloud sample
Pointcloud sample
 

Andere mochten auch

Andere mochten auch (13)

NARCOTRÁFICO SA (DOPE INC.)
NARCOTRÁFICO SA (DOPE INC.)NARCOTRÁFICO SA (DOPE INC.)
NARCOTRÁFICO SA (DOPE INC.)
 
Narcotráfico e identidade midiática no documentário falcão meninos do tráfico
Narcotráfico e identidade midiática no documentário falcão   meninos do tráficoNarcotráfico e identidade midiática no documentário falcão   meninos do tráfico
Narcotráfico e identidade midiática no documentário falcão meninos do tráfico
 
Narcotrafico
NarcotraficoNarcotrafico
Narcotrafico
 
Terrorismo e Narcotráfico
Terrorismo e NarcotráficoTerrorismo e Narcotráfico
Terrorismo e Narcotráfico
 
NarcotráFico
NarcotráFicoNarcotráFico
NarcotráFico
 
Alguma Coisa Tá Fora
Alguma Coisa Tá ForaAlguma Coisa Tá Fora
Alguma Coisa Tá Fora
 
Geopolítica do Narcotráfico
Geopolítica do NarcotráficoGeopolítica do Narcotráfico
Geopolítica do Narcotráfico
 
As FARC
As FARCAs FARC
As FARC
 
O Narcotráfico na América Latina
O Narcotráfico na América LatinaO Narcotráfico na América Latina
O Narcotráfico na América Latina
 
Conflitos Na América Latina
Conflitos Na América LatinaConflitos Na América Latina
Conflitos Na América Latina
 
História e cultura da colômbia
História e cultura da colômbiaHistória e cultura da colômbia
História e cultura da colômbia
 
Tráfico e violência
Tráfico e violênciaTráfico e violência
Tráfico e violência
 
Conflitos mundiais.
Conflitos mundiais.Conflitos mundiais.
Conflitos mundiais.
 

Ähnlich wie Globalandlocal (10)

Kumpulan contoh-program-pascal
Kumpulan contoh-program-pascalKumpulan contoh-program-pascal
Kumpulan contoh-program-pascal
 
Kumpulan program pascal
Kumpulan program pascalKumpulan program pascal
Kumpulan program pascal
 
Python programs - first semester computer lab manual (polytechnics)
Python programs - first semester computer lab manual (polytechnics)Python programs - first semester computer lab manual (polytechnics)
Python programs - first semester computer lab manual (polytechnics)
 
Algoritma
AlgoritmaAlgoritma
Algoritma
 
2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units2Bytesprog2 course_2014_c8_units
2Bytesprog2 course_2014_c8_units
 
Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)Python programs - PPT file (Polytechnics)
Python programs - PPT file (Polytechnics)
 
stack.pptx
stack.pptxstack.pptx
stack.pptx
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets2Bytesprog2 course_2014_c1_sets
2Bytesprog2 course_2014_c1_sets
 
python practicals-solution-2019-20-class-xii.pdf
python practicals-solution-2019-20-class-xii.pdfpython practicals-solution-2019-20-class-xii.pdf
python practicals-solution-2019-20-class-xii.pdf
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
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;