????????????? IF - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

????????????? IF

Description:

IF Program number; Uses wincrt; Var first,second : integer; Begin Write('input your first ');readln(first); Write('input your ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 6
Provided by: com1176
Category:
Tags:

less

Transcript and Presenter's Notes

Title: ????????????? IF


1
????????????? IF
  • Program number
  • Uses wincrt
  • Var first,second integer
  • Begin
  • Write('input your first ')readln(first)
  • Write('input your second')readln(second)
  • If first gt second Then write('first gt
    second ',first-second)
  • else write('first lt second
    ',firstsecond)
  • End.

2
  • Program number
  • Uses wincrt
  • Var score integer
  • Begin
  • Write('input your score ')readln(score)
  • If score gt 50 Then write('pass')
  • else write('fail')
  • End.

3
  • program cheak_weight
  • uses wincrt
  • var sex char
  • tall,weight,weight_s real
  • begin
  • write('iput your sex F or M ')readln(sex)
  • write('iput your tall ')readln(tall)
  • write('iput your weight ')readln(weight)
  • IF sex 'F' Then weight_s tall-110
  • else
  • weight_s tall-100
  • IF weight gt weight_s then
  • begin
  • writeln('your are fat')
  • writeln('your weight_s is
    ',weight_s32)
  • writeln('weight overload is
    ',weight-weight_s32)
  • end
  • else
  • begin

4
  • Program number
  • Uses wincrt
  • Var num,result integer
  • Begin
  • Write('input number ')readln(num)
  • result num mod 2
  • If result 0 Then write('ku')
  • else write('ke')
  • End.

5
  • Program Case_Example
  • Uses wincrt
  • Var ansinteger
  • base, tall,area_t real
  • num1,num2integer
  • Begin
  • writeln('area')
  • writeln('1.area tritangle
    ')
  • writeln('2.area squar
    ')
  • writeln('3.area circle')
  • write('Select area 1-3')readLn(ans)
  • Case ans of
  • 1 begin
  • write('input base')readln(base)
  • write('input tall')readln(tall)
  • area_t 1/2basetall
  • writeln('area tritangle',area_t3
    2)
  • end
  • 2 begin
Write a Comment
User Comments (0)
About PowerShow.com