Question: Write a C code to enter two non - negative integers ( n and x ) , then print the frequency of digit x in

Write a C code to enter two non-negative integers (n and x), then print the frequency of digit x in the number n.- both n and x should be positives or zero. If neither is negative, then print (invalid input)- n can be any non-negative number, while x should be a digit (acceptable values are between 0 and 9 only). If the user enters x outside the range [0,9], then print (invalid digit) Example: n =123219911 x =1, then the frequency is =4(1 is repeated 4 times in n) n =-12319 x =9, then print (invalid input) n =12434259 x =43, then print (invalid digit)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!