Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  abeb
Language: PASCAL
Code:
program Sample;
var
  num1,num2,sum,i,temp:integer;
begin
repeat
 write('Please enter first number: ');
 readln(num1);
 write('Please enter second number: ');
 readln(num2);
until num1<>num2;
begin
temp:=num1;
num1:=num2;
num2:=temp;
end;
 sum:=0;
For i:=num1 to num2 do 
  sum:=i+sum;
  writeln(num1,'+',num1+1,'+....+',num2,'=',sum);
readln
end.
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
Comments: