Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,166 questions

40,722 answers

573 users

How to convert a string to uppercase in C

2 Answers

0 votes
#include <stdio.h> 
#include <ctype.h> 
  
int main(void)
{   
    char s[30] = "c c++ c# java";
    int i = 0;
  
    while(s[i])
    {
      s[i] = toupper(s[i]);
      i++;
    }
     
    puts(s);
       
    return 0;
}
  
     
/*
run:
  
C C++ C# JAVA
 
*/

 





answered Jan 11, 2017 by avibootz
edited Jan 11, 2017 by avibootz
0 votes
#include <stdio.h> 
#include <ctype.h> 
 
int main(void)
{   
    char s[30] = "c c++ c# java";
    int i = 0;
 
    while(s[i])
    {
      putchar(toupper(s[i]));
      i++;
    }
      
    return 0;
}
 
    
/*
run:
 
C C++ C# JAVA

*/

 





answered Jan 11, 2017 by avibootz

Related questions

1 answer 58 views
58 views asked Apr 6, 2021 by avibootz
1 answer 94 views
1 answer 79 views
...