[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


i would like to create a program in which it will read in a...

<< Back to: comp.lang.c Answers to Frequently Asked Questions (FAQ List)

Question by Aces
Submitted on 3/10/2004
Related FAQ: comp.lang.c Answers to Frequently Asked Questions (FAQ List)
Rating: Not yet rated Rate this question: Vote
i would like to create a program in which it will read in a sentence when I enter a sentence and the computer will display the number of alphabets in my sentence.. example "i am grace", then the output will be: a=1, b=0, c=1... so on....
please email me the answer at angel_bhe12@yahoo.com


Answer by Daniel
Submitted on 3/24/2004
Rating:  Rate this answer: Vote
You'll need to create an array of 26 integers, then read characters one at a time, check if they're letters of the alphabet, and increment the appropriate element of the array if so. Then use another loop to do output.

 

Answer by harish
Submitted on 4/7/2004
Rating: Not yet rated Rate this answer: Vote
# include <stdio.h>

int main (void)
{
int arr [26] ={0,0};
int ch;
int i = 0;
while (( ch = getchar () ) != EOF)
   if (ch >= 'a' && ch <= 'z')
    arr [ch - 'a'] ++;

for (i = 0; i< 26;i++)
  printf ("%d",arr[i]);
}

 

Answer by jasper
Submitted on 11/2/2004
Rating: Not yet rated Rate this answer: Vote
Monk,datagram  daftest   Nabokov negativing  nigh

 

Answer by Mooney
Submitted on 11/13/2004
Rating: Not yet rated Rate this answer: Vote
What do you use to program?

 

Answer by Ollie
Submitted on 7/4/2005
Rating: Not yet rated Rate this answer: Vote
Please could someone tell me how to create a program and what to create it in, of automated data entry on the internet eg. Name and address, AND DONT TELL ME ABOUT THE WHOLE HISTORY THING BECOZ I KNOW!, reply at oliverjmpotts@hotmail.com

Many thanks

 

Answer by mhela
Submitted on 10/8/2005
Rating: Not yet rated Rate this answer: Vote
how can i create a program here in i have a 3 important headings.. and when i type any of the 3 or all the subheadings of that will appear.. for example the 3 important headings are model, assembly, sub-assembly.. i f i type the 3 headings, all the profile that consist of that will be viewed.. but when i type only the a certain model and certain assembly, that will only be viewed.. i hope you understand what i have written.... thanks
please email me... mhela_888@yahoo.com

 

Answer by mohan,moni_mvj99@yahoo.com
Submitted on 12/15/2005
Rating: Not yet rated Rate this answer: Vote
#include<stdio.h>
#include<string.h>
void main()
{
    char s[100];
    int n,a,b...........z,i;
    printf("enter string ");
    gets(s);
    n=strlen(s);
    for(i=0;i<n;i++)
    {
       if(s[i]=='a')
      a=a+1;  
    
if(s[i]=='b')
      b=b+1;
.
.
.
.
.
..
if(s[i]=='z')
z=z+1;
}
printf("a is %d",a);
printf("b is %d",b);
}

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: comp.lang.c Answers to Frequently Asked Questions (FAQ List)


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.