ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N 
TIMES C COMES N TIMES D COMES N TIMES  AND SO ON......... 
AT LAST UNTIL Z COMES N TIMES...............
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............
Answer
# 1
this  logic is for 'A'(capital) to 'z'(small)......


#include<stdio.h>
#include<conio.h>
void main()
{
int count;
char str[100];
printf("enter the string :");
gets(str);
for(int i=65;i<=122;i++)
{
  count =0;
  for(int j=0;str[j]!='\0';j++)
    {
       if(str[j]==i)
        count++;
    }
printf("the character %c occurs %d times \n",i,count);
}
getch();
}

         thank you
 
Is This Answer Correct ?    4 Yes 2 No
Vignesh1988i
 
  Re: WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............
Answer
# 2
m   minor modification


#include<stdio.h>
#include<conio.h>
void main()
{
int count;
char str[100];
printf("enter the string :");
gets(str);
for(int i=65;i<=122;i++)
{
  count =0;
  for(int j=0;str[j]!='\0';j++)
    {
       if(str[j]==(char)i)
{
printf("the character %c occurs %d times \n",i,count);

        count++;
}
    }
}
getch();
}

            thank you
 
Is This Answer Correct ?    2 Yes 0 No
Vignesh1988i
 
 
 
  Re: WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............
Answer
# 3
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,count;
char str[100];
clrscr();
printf("enter the string :");
gets(str);
for(i=65;i<=122;i++)
{
  count =1;
  for(j=0;str[j]!='\0';j++)
    {
       if(str[j]==i)
        count++;
    }
printf("the character %c occurs %d times \n",i,count);
}
getch();
}

 
Is This Answer Correct ?    2 Yes 0 No
Priyanka
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Why preprocessor should come before source code?  2
what is op? for(c=0;c=1000;c++) printf("%c",c); Trigent18
Find string palindrome 10marks Honeywell5
what is the difference between. system call and library function? CDAC2
Write code for initializing one dimentional and two dimentional array in a C Program? Deshaw5
what does the following function print? func(int i) { if(i%2)return 0; eale return 1; } main() { int =3; i=func(i); i=func(i); printf("%d",i);} TCS8
which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%  4
related to rdbms query .  1
which types of data structure will i use to convert infix to post fix??? IIT3
how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.  1
hat is a pointer? Assurgent3
difference between semaphores and mutex?  1
Can we include one C program into another C program if yes how? Infosys4
which one is highest Priority in c? a)=,b)+,c)++,d)==  3
Why is conio.h not required when we save a file as .c and use clrscr() or getch() ?  2
difference of two no's with out using - operator  6
what is the advantage of software development  1
#include<stdio.h> int SumElement(int *,int); void main(void) { int x[10]; int i=10; for(;i;) { i--; *(x+i)=i; } printf("%d",SumElement(x,10)); } int SumElement(int array[],int size) { int i=0; float sum=0; for(;i<size;i++) sum+=array[i]; return sum; } output? Ramco5
if ENTERED FIVE DIGITS DESIGN A PROGRAM THAT WILL FIND CORRESPONDING VALUE FROM ASCII TABLE  1
How many types of linked lists what are they? How many types of data structures? BSNL5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com