regarding above question, i know to find char i can use strlen tofind the number
ID: 3616309 • Letter: R
Question
regarding above question, i know to find char i can use strlen tofind the number of character in the paragraph.but is there any other function that i can use to find theword in a paragraph that only have a-z char fexample: hello worldbe 2 words. and "it's" would be 2 words.
how about finding most 3 frequent char in a the paragraph?fexample "aaaabb" will printout a=4 b=2. and how to find substringin the paragraph such that substring "do" in "howdoyoudo"is 2 butoverlaping should be taken into account such as substring "aa"in"aaaabbaa" should be 4 occurence of "aa" instead of 3.
lastly how to Reverse the word in the text. In this case, aword is regarded as continuous characters without ' ' and ' ' init. So "it's" is one word,"http:www.cramster.com" is also oneword. If the original text is " i'm here, mom", the resulting text should be "mom here, i'm ".
i would appriciate if you could gave the right type of function tosolve this problems. and how can i rate u or give u points for helping me? sorry im newto the cramste regarding above question, i know to find char i can use strlen tofind the number of character in the paragraph.
but is there any other function that i can use to find theword in a paragraph that only have a-z char fexample: hello worldbe 2 words. and "it's" would be 2 words.
how about finding most 3 frequent char in a the paragraph?fexample "aaaabb" will printout a=4 b=2. and how to find substringin the paragraph such that substring "do" in "howdoyoudo"is 2 butoverlaping should be taken into account such as substring "aa"in"aaaabbaa" should be 4 occurence of "aa" instead of 3.
lastly how to Reverse the word in the text. In this case, aword is regarded as continuous characters without ' ' and ' ' init. So "it's" is one word,"http:www.cramster.com" is also oneword. If the original text is " i'm here, mom", the resulting text should be "mom here, i'm ".
i would appriciate if you could gave the right type of function tosolve this problems. and how can i rate u or give u points for helping me? sorry im newto the cramste
Explanation / Answer
please rate - thanks this should get you started #include #include #include void input(char[]); void stats(char[]); void reverse(char[]); void substring(char[]); int main() {int choice; char data[1001]={""}; printf("What whould you like to do? 1 - Input text "); printf("2 - Text Stats "); printf("3 - Find Substring "); printf("4 - Reverse Text "); printf("5 - Quit "); scanf("%d",&choice); while(choice!=5) {switch(choice) {case 1: input(data); break; case 2: stats(data); break; case 3: reverse(data); break; case 4: substring(data); break; default: printf("Error!! TryAgain "); } printf("What whould you like to do? 1 - Input text "); printf("2 - Text Stats "); printf("3 - Find Substring "); printf("4 - Reverse Text "); printf("5 - Quit "); scanf("%d",&choice); } getch(); return 0; } void input(char d[]) {int i,good=1; while ((getchar()) != ' '); do { i=0; good=1; printf("input your text: "); d[i]=getchar(); while(d[i]!=' '&&good==1) {i++; if(i==1000) {printf("Too manycharacters- try again"); while((getchar()) != ' '); good=0; } if(good==1) d[i]=getchar(); } }while(good==0); return; } void stats(char d[]) { //insert code here return; } void reverse(char d[]) { //insert code here return; } void substring(char d[]) { //insert code here return; }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.