program to (keep taking number as input from user until user enters a number which is multiple of 5.)

 //keep taking number as input  from user until user enters a number which is multiple of 5.

#include<stdio.h>

int main()

{

int n;

do{
printf("enter any number=");
scanf("%d", &n);
printf("%d\n", n);
if(n % 5 == 0){
break;
}
}
while(1);

printf("you have entered multiple of 5 ");
return 0;
}

output :

enter any number=1
1
enter any number=2
2
enter any number=4
4
enter any number=5
5
you have entered multiple of 5
--------------------------------
Process exited after 5.066 seconds with return value 0
Press any key to continue . .


Comments

Popular posts from this blog

Write a program to check if a number is prime or not.

Write a program to print the grades to a student.

write a program (keep taking numbers as input from user until user enters an Odd number)