Question

Use C programe to : Develop an algorithm, flow chart and write a C program to...

Use C programe to :

Develop an algorithm, flow chart and write a C program to read the name of a patient which has a multi word and display it and the acromatic string of the name.

Sample Output : Name : Khamis Al Araimi

                           Acromatic String: AKAA.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>
#include<string.h>
int main()
{

int index,length,flag = 0;
char name[100], Acr_name[100], buffer[100];
/* If you want 'A' infornt of Acromatic string Intialize Acr_name[100] = "A"
because your required output has A in starting but as of my knowledge acromatic name does not need A in starting */
printf("Please enter Patient Name:");
scanf("%[^\n]", name);
length = strlen(name);

for (index = 0;index <= length;index++)
{
   if (index == 0)
   {
       strncpy(buffer,&name[index],1);
       strcat(Acr_name, buffer);
   }
   else if (name[index] == 32)
   {
       flag = 1;
   }
   else if(flag == 1)
   {
       strncpy(buffer,&name[index],1);
       strcat(Acr_name, buffer);
       flag =0;
   }

}
printf("Name : %s\nAcromatic String: %s\n",name, Acr_name);
}

Add a comment
Know the answer?
Add Answer to:
Use C programe to : Develop an algorithm, flow chart and write a C program to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use c program to: The clinic wish to give 15% discount on the fees to be...

    Use c program to: The clinic wish to give 15% discount on the fees to be paid by the patients whose age is above 60. Develop an algorithm, flow chart and write a C program to read age of the patient and calculate the fees after the discount by writing a function with argument. Display the result with appropriate statements.

  • Q4. Write an algorithm, draw the flowchart and write a C++ program to • Read the...

    Q4. Write an algorithm, draw the flowchart and write a C++ program to • Read the Number and Letter from the user • Check the number and letter then print the corresponding month name as given in Table Q4 using IF ELSE STATEMENT. Table: Q4 Number and Letter Month Name JANUARY 2 F FEBRAURY 3 M MARCH 4 A APRIL Other numbers Invalid Input 1J Sample Output: Enter the value of number:1 Enter the value of letter:) JANUARY Algorithm: Flowchart:...

  • Develop a functional flowchart and then write a C++ program to solve the following problem. 1....

    Develop a functional flowchart and then write a C++ program to solve the following problem. 1. Create a text file named c1.txt and write your brand of computer (like Dell, HP, etc) in the file. You will be reading the name of the file from the keyboard as a string, using the string class. Your program will also read the brand of your computer from the keyboard. The process of the file creation (name of the file, mode for opening...

  • A Private Poly Clinic in Oman wish to develop software to automate their Patient Monitoring system...

    A Private Poly Clinic in Oman wish to develop software to automate their Patient Monitoring system for storing the details of the patients visited the clinic. Develop a system to meet the following requirements: The clinic wish to give 15% discount on the fees to be paid by the patients whose age is above 60. Develop an algorithm, flow chart and write a C program to read age of the patient and calculate the fees after the discount by writing...

  • java programe Write a program that prompts the user to enter in an integer number representing...

    java programe Write a program that prompts the user to enter in an integer number representing the number of elements in an integer array. Create the array and prompt the user to enter in values for each element using a for loop. When the array is full, display the following: The values in the array on a single line. The array with all of the elements reversed. The values from the array that have even numbered values. The values from...

  • write a program in C Write a program to implement the following requirement: The program will...

    write a program in C Write a program to implement the following requirement: The program will read from standard input any text up to 10, 900, characters and store each unique word (any string that does not contain any whitespace) into a node of a linked list, following the following Node struct: struct NODE { char *word; struct NODE * prev; Note that each node must store a unique word, i.e., no word is stored in more than one node....

  • A Private Poly Clinic in City wish to develop software to automate their Patient Monitoring system...

    A Private Poly Clinic in City wish to develop software to automate their Patient Monitoring system for storing the details of the patients visited the clinic. Develop a system to meet the following requirements: Patient Id Fees in (OMR)       Gender P001 15 M P002 10 F P003 20 M P004 8 F P005 12 M The clinic wish to give 15% discount on the fees to be paid by the patients whose age is above 60. Develop an algorithm,...

  • 2. (5 marks) Write an algorithm as a flow chart that reads in values for a...

    2. (5 marks) Write an algorithm as a flow chart that reads in values for a series of numbers (so you will have to read in inside a loop, and test for EOF to end the loop). For each number, if it is the algorithm will print out "Positive". The algorithm should stop when five negative numbers have been found.

  • C Programming // use stdio.h, stdlib.h, string.h and math.h only. Write a program that prompts the...

    C Programming // use stdio.h, stdlib.h, string.h and math.h only. Write a program that prompts the user to enter a word that has 3 letters. Store this as a character array (i.e. strings in C). Create a new character array that stores the reverse of the word and display on the screen. Sample output is as follows: Enter a word with 3 letters> bee Word entered: bee Reverse word: eeb

  • Write a program named "VegetablePricer" which prompts the user for a vegetable from the pricing table...

    Write a program named "VegetablePricer" which prompts the user for a vegetable from the pricing table shown below. The program will then display the cost per pound for that vegetable, again using the table provided. Your program must use a switch statement to process the input value and display the desired output. Be sure to provide a default case in your switch statement which handles unrecognized input. Use named constants for all constant strings (e.g. prompts and vegetable names) and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT