ProAnswers.org

C program to calculate the square of those numbers only whose least significant digit is 5

#include<stdio.h>
int main()
{
int n;
int s;
int ls;
printf(“Enter the number whose least significant digit is 5 \n”);
scanf("%d",&n);
ls=n%10;
if(ls== 5)
{
s = n*n;
printf(“Square of the number is = %d”,s);
}
return 0;
}