Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/Perl-Scripting.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Perl-Scripting/sub_routine_prob.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/perl
use strict;
use warnings;

# Subroutine to check even or odd
sub check_even_odd {
my ($num) = @_; # Get the number from arguments
return $num % 2 == 0 ? "$num is Even\n" : "$num is Odd\n";
}

# Taking user input
print "Enter a number: ";
my $num = <STDIN>;
chomp($num);

# Calling the subroutine and printing result
print check_even_odd($num);