Answer:
The program in C is as follows:
void prints(char arr[], int n){
int count =0;
for(int i=1 ;i<=n; i++){
for(int j=1;j<=i; j=j*2){
count++; } }
for(int i =0;i<count;i++){
printf("%s ",arr);
}
}
Explanation:
This defines the method
void prints(char arr[], int n){
This declares and initializes count variable to 0
int count =0;
This creates the outer loop
for(int i=1 ;i<=n; i++){
This creates the inner loop
for(int j=1;j<=i; j=j*2){
This increments count by 1
count++; } }
This iterates through count
for(int i =0;i<count;i++){
And print the string in count times. If count is 3, the string will be printed 3 times.
printf("%s ",arr);
}
}
See attachment for complete program that includes the main method
Answer:
Here is the Python program:
#the method acronym that takes an argument phrase
def acronym(phrases):
acronym = "" #to store acronym of a phrase
#loop to split the input phrase and return its acronym in upper case letters
for phrase in phrases.split():
acronym = acronym + phrase[0].upper()
return acronym
#main function that takes input phrase from user and display its acronym
def main():
phrases = input("Enter a phrase: ")
print("The acronym for your phrase is ",acronym(phrases))
main()
Explanation:
First let me explain the method acronym. This method takes a parameter phrase to return its corresponding acronym. First the phrase is split using split() method which is used to return the list of words in a phrase. For loop is used that will keep splitting the words in the string (phrase) entered by the user.
In this statement: acronym = acronym + phrase[0].upper() the acronym is computed. phrase[0] means the first character of each word in the phrase which is found out by the split() method is converted to upper case by using upper() function and then stored in acronym variable. Each time the acronym is found and its first character is converted to upper case and added to the acronym variable.
Then the main() function prompts the user to enter a phrase and then calls the acronym function and passed that phrase as parameter to that function. Then the computed acronym for the phrase is printed on the screen.
Computers are the excellent means for storage of patient related data.It is often necessary to maintain detailed records of the medical history of patients. Doctors often require the information about a patient's family history, physical ailments, already diagnosed diseases and prescribed medicines.
seach up this on goggle many great videos will pop up
Explanation:
<3