write a program to count the no of repaeted words in a line?

Answer Posted / k raja sekhar

create a linked list of stucture having 2 feilds
1. string "to keep the string"
2. int "to maintain count"

get a word from the line, check in a array say words[]. if it is available just increase the count of the word in the linked list if not create a new node and insert the word in the array.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c called a structured programming language?

686


Can we declare variables anywhere in c?

582


Why is c called "mother" language?

861


The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.

1070


Explain the priority queues?

629






Write programs for String Reversal & Palindrome check

601


How can a program be made to print the name of a source file where an error occurs?

735


How do you override a defined macro?

704


Explain how do you determine a file’s attributes?

599


How old is c programming language?

584


#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }

776


can we change the default calling convention in c if yes than how.........?

2037


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

619


Explain goto?

722


a program that can input number of records and can view it again the record

1488