PROGRAM:
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
void main() {
clrscr();
int len,chr;
char ch[50];
cout<<"Program to conver lowercase to uppercase and uppercase to lowercase:\n";
cout<<"Enter Your Name: ";
gets(ch);
len=strlen(ch);
for(int i=0;i<len;i++) {
chr = ch[i];
if(isupper(chr))
chr = tolower(chr);
else
chr = toupper(chr);
putchar(chr);
}
getch();
}//end of the program
No comments:
Post a Comment