Wednesday, 7 October 2015

Write a CPP Program To Find Remainder Of Input Number

Write a CPP Program To Find Remainder Of Input Number
1:  #include<iostream.h>  
2:  #include<stdio.h>  
3:  int main()  
4:  {  
5:    int n,rem;  
6:    cout<< "Enter number"<<endl;  
7:    cin>>n;  
8:    for(;n>0;n=n/10)  
9:    {  
10:      rem=n%10;  
11:      cout<< rem;  
12:    }  
13:  }  

No comments:

Post a Comment