Second exemple of if ..else condition
17. Write a program which can read an integer value from
key board and test weather it is dividable by 5 or not ( 5
Øviv wefvR¨ wK bv Zv cix¶v Ki).
void main(){
int num,m;
printf("\nEnter an inter vlaue
=");
scanf("%d",&num);
m = num%5;
if(m == 0)
{
printf("\n%d is dividable by
5",num);
}
else
{
printf("\n%d is not dividable by
5",num);
}
}
No comments:
Post a Comment