Tuesday, March 1, 2016

Small to Capital letter in C

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <stdio.h>

int main(){
 char name[]={'h', 'u', 'm','a', 'u','n'};
 int i, lenth;
 printf("%s\n", name);   
 lenth=6;
 for (i=0;i<6; i++){
  if (name[i]>=97 && name[i<=122]){
   name[i]='A'+name[i]-'a';
  }
  
 }
 printf("%s",name);
 return(0);
 
}

No comments:

Post a Comment

Thank you for commenting. Please wait for response :)