write a C program to convert a line in the lowercase text to uppercase.
Answers
Answered by
2
Answer:
??????????!!!
consa case bhai
Answered by
1
Explanation:
/**
* C program to convert string to uppercase
*/
#include <stdio.h>
#define MAX_SIZE 100 // Maximum string size
int main()
{
char str[MAX_SIZE];
int i;
/* Input string from user */
printf("Enter your text : ");
gets(str);
for(i=0; str[i]!='\0'; i++)
{
/*
* If current character is lowercase alphabet then
* convert it to uppercase.
*/
if(str[i]>='a' && str[i]<='z')
{
str[i] = str[i] - 32;
}
}
printf("Uppercase string : %s",str);
return 0;
}
Similar questions