Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

1. Write a C program to count the number of occurrence
of
a specific word in the given strings.
(for e.g. Find how many times the word “live” comes in the
sentence “Dream as if you’ll live forever, live as if
you’ll die today ”)

Answer Posted / jyoti

#include<stdio.h>
#include<conio.h
#include<string.h>
void main()
{
char st[200],nw[20];
int i,j=0;
clrscr();
printf("enter string");
gets(st);
printf("enter new string");
gets(nw);
for(i=0;st[i]!='\0';i++)
{if (strcmp(nw,st)==0)
j=j++;
}}
getch();
}

Is This Answer Correct ?    68 Yes 183 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2554


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

2162


How do you generate random numbers in C?

1143


How do you list a file’s date and time?

1020


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

1065


Explain 'bus error'?

1008


How to Throw some light on the splay trees?

997


When should a far pointer be used?

1056


Why do we use static in c?

1063


What is ctrl c called?

999


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

992


What is dangling pointer in c?

1125


FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.

1704


why wipro wase

2244


Is it valid to address one element beyond the end of an array?

1114