How to uppercase (capitalize) the first letter (character) of a string in C

1 Answer

0 votes
#include <stdio.h> 
#include <ctype.h> 

int main(void)
{   
    char s[] = "c programming language";
    
    s[0] = toupper(s[0]);
    
    puts(s);
    
    return 0;
}
   
      
/*
run:
   
C programming language
  
*/

 



answered Jan 25, 2017 by avibootz
...