Answers for "convert to lowercase in c"

C
3

convert to lowercase in c

/* Use the tolower Function to Convert String to Lowercase in C */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main(){
    char *str = "THIS STRING LITERAL IS ARBITRARY";

    printf("%s\n", str);
    for (size_t i = 0; i < strlen(str); ++i) {
        printf("%c", tolower((unsigned char) str[i]));
    }
    printf("\n");

    exit(EXIT_SUCCESS);
}
Posted by: Guest on August-24-2021
-1

convert string to lowercase in c

// include all the libraries  used in the program.
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <string.h>
#include <math.h>

// Base Function
int main(int argc, string argv[])
{
    if (argc != 2)
    {
        printf("Usage: ./substitution key\n");
    }
    else if (strlen(argv[1]) != 26)
    {
        printf("Key must contain 26 characters.\n");
    }
    
    string key = argv[1].toupper();
    string key = argv[1].tolower();
}
Posted by: Guest on February-22-2021

Code answers related to "convert to lowercase in c"

Code answers related to "C"

Browse Popular Code Answers by Language