Untitled
unknown
plain_text
2 years ago
277 B
6
Indexable
#include <iostream> using namespace std; int main() { int num,n,count=0; cout<<" enter number "; cin>>num; cout<<"enter digit "; cin>>n; if(num>0) { while(num!=0) { if(num%10==n) { count++; } num=num/10; } cout<<"There are "<<count<<" times the digit"; } }
Editor is loading...