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
Name:
Elanso [62]
1 6gb of ram
inteel
500gb
500gb
4 0
3 years ago
I will give Brainliest to the best answer, I need urgent HELP
laila [671]
The answer is B. Range
4 0
3 years ago
Identify the operation which is NOT one of the parts of the fivebasic set operations in relational algebra?
wariber [46]

Answer:

Join

Explanation:

Five basic set operators in relational algebra are as follows:

  • Selection - tuple selection
  • Projection - extract columns
  • Cartesian product - cross product of relations
  • Set union - union of two relations
  • Set difference - minus operation on two relations

As we can see, Join is not part of the basic set operations but it is implemented using the Cartesian Product operator.

5 0
3 years ago
Blogs differ from most other online text sources because they
allochka39001 [22]
Tell you what a person's life is like
4 0
4 years ago
Read 2 more answers
Talon is a new game designer working on an exciting and innovative game idea, but its time to examine the idea for technical fea
GarryVolchara [31]

Answer:

I think the answer is C.

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following accurately completes this sentence? The Internet is ____.
    6·2 answers
  • What operating system allows various teams in its office to network and collaborate on projects
    5·1 answer
  • Your new home has a vacuum system. what kind of computer is controlling it?
    5·1 answer
  • There is no way to see how another project in Scratch was made.<br><br> True<br> False
    11·1 answer
  • Write the definition of a class Counter containing: An instance variable named counter of type int. An instance variable named l
    14·1 answer
  • Some computer engineering students decided to revise the LC-3 for their senior project. In designing the LC-4, they decided to c
    13·1 answer
  • Consider the following classes: public class Vehicle {...} public class Car extends Vehicle {...} public class SUV extends Car {
    8·1 answer
  • Can anyone please help with this programming code in python num= 7 if num &gt; 3: print(“3”) if num &lt; 5: print(“5”) if num ==
    6·1 answer
  • What is the best way to improve an online search?
    11·2 answers
  • Consider the following correct implementation of the selection sort algorithm.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!