Puts "Enter A Number" N Gets - To - I F 1 I 1 While I N Do F F I I I+1 End Puts "Factorial of # (N) Is # (F) "
Puts "Enter A Number" N Gets - To - I F 1 I 1 While I N Do F F I I I+1 End Puts "Factorial of # (N) Is # (F) "
Write Ruby program reads a number and calculates the factorial value of it and prints the
same.
Aim:To develop an ruby program reads a number and calculates the factorial value and print it.
Source code:
Output:
Roll No:17A81A0570
Write a Ruby program which counts number of lines in a text file using its regular expressions
facility.
Aim:To develop a ruby program which counts number of lines in a text file using its regular
expressions facility.
Source code:
Output:
Roll No:17A81A0570
Write a Ruby program that uses iterator to find out the length of a string.
Aim:To develop a ruby program that uses iterator to find out the length of a string.
Source code:
output:
Roll No:17A81A0570