Program
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
char base[48]="1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./";
char c[100];
int i,l;
cout<<"\n\tEnter the String: ";
gets(c);
l=strlen(c);
strupr(c);
for(i=0;i<l;i++)
{
int j;
for(j=0;j<47;j++)
{
if((base[j]==c[i]) && c[i]!='q' && c[i]!='a' && c[i]!='z')
{
cout<<base[j-l];
}
else if(c[i] == ' ')
{
cout<<" ";
break;
}
}
}
return 0;
}
output
No comments:
Post a Comment