Wednesday, March 24, 2021

13.1. Write a program that convert a line to upper case.

#include<stdio.h>
#include<conio.h> 
#include<string.h>
void main ()
{
char st[100];
int i,l;
clrscr();
printf ("Enter any line: ");
gets(st);
1=strlen(st);
for(i=0; i<l; i++)
if(st[i] >='a' && st[i]<='z') 
printf("%c", st[i]-32);
else
printf("%c", st[i]);
getch ();
}

No comments:

Post a Comment