In C write a function capitalize that takes as an argument a

In C: write a function \"capitalize\" that takes as an argument a character array and an integer for the size of the array. It should capitalize each letter in the array. Assume that the array only has characters \'a\' through \'z\'. Write the function, DO NOT include string.h in your program.
In C: write a function \"capitalize\" that takes as an argument a character array and an integer for the size of the array. It should capitalize each letter in the array. Assume that the array only has characters \'a\' through \'z\'. Write the function, DO NOT include string.h in your program.

Solution

#include <stdio.h> // standard input output
main(){
int i,j,size;// declaring variables
printf(\"Enter size of the array:\");// print to console
scanf(\"%d\",&size);// taking input
char string[size],ch;// declaring char type of string array and ch
scanf(\"%s\",&string); // taking array of characters into string
for(j=0;j<size+1;j++){// convert into upper case letter
printf(\"%c\",toupper(string[j]));
}

   getchar();
  

}

In C: write a function \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site