Pages

Sunday, 20 May 2012

program to print a String


88./*Write a program to print a String*/
#include<stdio.h>
#include<conio.h>
main()
{
            char n[20];
            int j;
            clrscr();
            printf("Enter a string");
            gets(n);
            for(j=0;n[j]!='\0'; j++)
            {
             if(n[j]>=65 && n[j]<=90)
             printf("%c",n[j]+32);
             else
             if(n[j]>=97 && n[j]<=122)
             printf("%c",n[j]);
             }
             getch();
 }

OUTPUT
            Enter a string MAHESH
            tejkumar

No comments:

Post a Comment