Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to toggle case of letters of a string.
- #include<iostream.h>
- #include<conio.h>
- #include<stdio.h>
- #include<ctype.h>
- void main()
- {
- clrscr();
- char a[80];
- cout<<"Enter a string: ";
- gets(a);
- for(int i=0;a[i]!='\0';i++)
- {
- if(isupper(a[i]))
- a[i]=tolower(a[i]);
- else
- a[i]=toupper(a[i]);
- }
- puts(a);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment