Write a C program to read a sentence and replace lowercase characters with uppercase and vice versa.

Question

Write a C program to read a sentence and replace lowercase characters with uppercase and vice versa.
🧐 Not the exact question you are looking for?Go ask a question

Solution 1

Sure, here is a simple C program that reads a sentence and replaces lowercase characters with uppercase and vice versa.

#include <stdio.h>

void convertCase(char *str) {
    int i = 0;
    while(str[i] != '\0') {
        if(str[i] >= 'a' && str[i] <= 'z') {
            str[i] = str[i] - 32;
  
    Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study prob
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solv

This problem has been solved

Similar Questions

Write a C program to read a sentence and replace lowercase characters with uppercase and vice versa.

Write a C program to read a sentence and replace lowercase characters with uppercase and vice versa without using fgets function and without using the pointer

Write a Python program to replace whitespaces with an underscore and vice versa.

Write a program that converts strings of all uppercase characters into strings of all lowercase and viceversa

Write a program that takes a string of lowercase characters as input and prints it in uppercase, reversed.

1/3