print"Enter a number: ";
$n=<STDIN>;
$s=0;
while($n>0)
{
$s=$s+($n%10);
$n=$n/10;
}
print"Sum is $s\n";
$n=<STDIN>;
$s=0;
while($n>0)
{
$s=$s+($n%10);
$n=$n/10;
}
print"Sum is $s\n";
www.studycsengg.gq
Copyright © Study CS Engg 2015. All rights reserved. Designed By Templateism | MyBloggerLab
0 comments:
Post a Comment