Ruby Program to Get the Successor of an Integer Number Using Library Function

Ruby program to get the successor of an integer number using library function

# Ruby program to get the successor of an 
# integer number using library function

num1 = 20;
num2 = -23

print "Successor of num1: ",num1.succ(),"\n";
print "Successor of num2: ",num2.succ(),"\n";
Successor of num1: 21
Successor of num2: -22
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment