+ 4
C program to find frequency of integers in a string
11 ответов
+ 4
diego Code I am a beginner.I have not yet completed studying ctype headerfile.Can u help me in another way
Thanks a lot
+ 3
I need to find the frequency of only numbers by neglecting the charecters in the string
Example
Input IND2020
output:frequency of 2 is 2
Frequency of 0 is 2
+ 3
*Asterisk* can u give me an idea how can I modify the program u mentioned to string
+ 3
diego Code I am a beginner.I have not yet completed studying ctype headerfile.Can u help me in another way
Thanks a lot
+ 2
First of all take a number as input and put a switch case for 0-9 integers. Now do number%10,number divided by 10 until it reaches 0. Inside switch case put count[i]. After this we can output frequency of each integer. Put a for loop for printing frequency from i=0 to i=9
+ 2
String is the mixture of characters and numbers
I think the solution u mentioned doesn't work.
+ 2
We can do typecasting
+ 2
Then by using ascii values we can count frequency by taking input as string
+ 2
Ruthvik Reddy check my code, you can use that
https://code.sololearn.com/ccX2i96usKXT/?ref=app
+ 2
I've included ctype.h to use isdigit() only...
You can replace the if (isdigit()) with
if (*s >= '0' && *s <= '9')
+ 1
Check this:
https://code.sololearn.com/ccR8xXa01758/?ref=app