-->
Showing posts with label 3)WAP to convert string into uppercase using strupr() function.. Show all posts
Showing posts with label 3)WAP to convert string into uppercase using strupr() function.. Show all posts

WAP to convert string into uppercase using strupr() function.

using turboc++
--------------------------------------------------------------------------------
//WAP to convert  a string into uppercase using(strupr()) function.
#include <stdio.h>
#include<string.h>
#include<conio.h>
int main()
{
    char name[100];//declaration
    printf("enter string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",name); //it also CAN BE USED. IT accepts string with space until it meets new line
    strupr(name);
    printf("string in uppercase=%s\n",name);//prints the name in uppercase
   getch();
    return 0;
}


------------------------------------------------------------------------------------------------
using codeblocks
--------------------------------------------------------------------------------------------------
//WAP to convert  a string into uppercase using(strupr()) function.
#include <stdio.h>
#include<string.h>
int main()
{
    char name[100];//declaration
    printf("enter string\n");
    //fgets(name, sizeof (name), stdin);//to input string with space
    scanf("%[^\n]s",name); //it also CAN BE USED. IT accepts string with space until it meets new line
    strupr(name);
    printf("string in uppercase=%s\n",name);//prints the name in uppercase
    return 0;
}