Strupr() function example program in C C++

Coding in C

#include<stdio.h>
#include<string.h>
int main()
{
    char name[20];
    printf("Enter name : ");
    scanf("%s",&name);
    strupr(name);
    printf("The name is: %s",name);
    return 0;
}

Coding in C++

#include<iostream>
#include<string.h>
using namespace std;
int main()
{
    char name[20];
    cout<<"Enter name : ";
    cin>>name;
    strupr(name);
    cout<<"The name is: "<<name;
    return 0;
}

Output

Strupr() function example program in C C++

Published by

admin

I am a computer teacher, programmer and web developer