1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
creativ13 [48]
3 years ago
5

Write a program to convert a string (of up to 20 characters, including the terminating null character) to all uppercase characte

rs. After getting a string that could include spaces (use the fgets() function and don't forget to strip off the ending if it is there), display the original string. Pass the string to a void function (since the 'string' is really as character array) and have the function convert the string to all uppercase by iterating through the string using a for loop and the strlen() function (which is part of the string.h library), and using the toupper() function (which is part of the ctype.h library) to convert each character in the string. Then, back in the main program, display the all uppercase string.
Computers and Technology
1 answer:
Harlamova29_29 [7]3 years ago
5 0

Answer:

Check the explanation

Explanation:

#include <stdio.h>

#include<ctype.h>

#include<string.h>

void MyToUpper(char *p)

{

  int i;

  for(i=0;i<strlen(p);i++)

  {

      p[i]=toupper(p[i]);

  }

}

int main(void) {

  char str[20];

  printf("Enter a string:");

  fgets(str,20,stdin);

printf("The string you entered was: %s\n",str);

MyToUpper(str);

printf("The string converted to uppercase is: %s\n",str);

fflush(stdin);

  return 0;

}

You might be interested in
Which of the following has a product less than 2/3
shusha [124]
2/3 and 3/5
2(5) = 10
3(3) =9 
10 > 9
3/5 is less than 2/3


Multiply numerator of the first fraction and denominator of second fraction.

Hope that helps!!!
3 0
3 years ago
What will you see on the next line?
sammy [17]

Answer:

c [2, 3.5, 7, 9]

Explanation:

8 0
3 years ago
According to the constitution, how long is a senator’s term?
il63 [147K]
According to the constitution, it's 6 years.
7 0
3 years ago
[ASAP!] Question # 6 (Visual Python)
oksano4ka [1.4K]
Hello!

The answer to your question is:
4. myBall.pos.y = myBall.pos.y + 2

Explanation, if you’d like one:
1. is incorrect as “z” isn’t a direction in which the ball can move.
2. is incorrect as “x” would be moving the ball right.
3. is incorrect as there is no direction defined.

I hope that this helps you out!
8 0
3 years ago
rite a complete function (DO NOT WRITE A COMPLETE PROGRAM: prototypes, no includes, no main, no input, no output) named average
qaws [65]

Answer:

double average(double* scores, int size)

{ double sum = 0;

for (int i = 0; i < size; i++)

     sum += scores[i];

return sum / size; }

Explanation:

Above is the function defined and its explanation is as follows:

              double average(double* scores, int size)

  • A variable average with data type double having two arguments scores(array of doubles having scores) and size(number of elements of array scores).

                                       double sum = 0;

                                      for (int i = 0; i < size; i++)

                                      sum += scores[i];

  • All the scores in the array are added into a variable named sum with data type double.

                               return sum / size;      

  • Return value will give the average of all the scores calculated by dividing sum of all the scores with size(total number) of scores.
5 0
3 years ago
Other questions:
  • An OU structure in your domain has one OU per department, and all the computer and user accounts are in their respective OUs. Yo
    12·1 answer
  • What is software ownership
    6·1 answer
  • What is the best practice to do an SEO for a HTML website? Is there any plug-in for this?
    13·1 answer
  • A bicycle sharing company is developing a multi-tier architecture to track the location of its bicycles during peak operating ho
    11·1 answer
  • Which of the following statements is false? Question 16 options: A) With non-static interface methods, helper methods can now be
    12·2 answers
  • What is the printout for the first statement in the main method?
    13·1 answer
  • Hi there. I need to know that if I take computer fundamentals, will that class teach anything about graphic design or digital de
    9·1 answer
  • What is work immersion and its nature​
    11·1 answer
  • Write an algorithm and draw flowchart to print 30 terms in the following sequence
    7·2 answers
  • Which operating system is used by most the supercomputer system in the world
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!