FY_BCA_C_SLIP 28_1



/* Slip no : 28_1 write a prog to accept string from user and display alternate charcter in upper case*/

#include<stdio.h>
#include<conio.h>
#include<ctype.h>

void main()
{
                char str[20];
                int i;
                clrscr();
                printf("\n Enter string : ");
                gets(str);
                for(i=0;str[i]!='\0';i=i+2)
                {
                                str[i]=toupper(str[i]) ;
                }

                printf("\n String is %s ",str);
                getch();
}

No comments:

Post a Comment