Answer Posted / anil kumar nahak
void main()
{
char *st,ch;
int i=0,c=0;
printf("\n Enter The String: ");
gets(st);
printf("\n Enter A character For finding occurance: ");
scanf("%c",&ch);
while(st[i]!='\0')
{
if(st[i]==ch)
c++;
i++;
}
printf("\n %c Present In The String %d Times",ch,c);
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain what is a const pointer?
What is calloc in c?
What is difference between structure and union?
Explain how can I convert a number to a string?
Write a code to remove duplicates in a string.
write a program to copy the string using switch case?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What is void main () in c?
What is the use of clrscr?
What is && in c programming?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
what is the role you expect in software industry?
Explain what are preprocessor directives?
Can include files be nested? How many levels deep can include files be nested?
Explain how can you tell whether a program was compiled using c versus c++?