isupper in c

If you want convert isupper in c then read this blog post.

What is isupper in c programming?

isupper function checks whether a given character is in uppercase or not.

This function is defined in ctype.h header file.

Prototype

int isupper(int a);

Parmeters

isupper function takes character as input parameter in c. The character is converted into ASCII value.

Return value

isupper function returns nonzero number if passed character is in uppercase otherwise zero.


Example program for isupper in c

Example 1

#include<stdio.h>
#include<ctype.h>
int main()
{
  char a='S';
  printf("\n\n\tPassed value is %d \n\n",isupper(a));
  return 0;
} 
Example 1 for isupper in c programming

Code explanation

isupper function is called to check whether the passed character is in uppercase or not. The result is being printed onto the console.


Example 2

#include<stdio.h>
#include<ctype.h>
int main()
{
  char a='s';
  printf("\n\n\tPassed value is %d \n\n",isupper(a));
  return 0;
} 
Example 2 for isupper in c programming

Code explanation

First, we have to include the stdio.h header and ctype.h header files in order to use isupper function to perform the operation. That we have done using #include macro.

Then we define a character variable.

We pass it to isupper function and print the result on console.

isupper() Man page


Difference between isupper and toupper in c

isupper function checks whether a character is in uppercase or not. toupper is a c library function that converts lowercase letters to uppercase letters.

isupper function returns non-zero number if a given character is in uppercase otherwise zero. toupper function returns converted uppercase letters as an integer which is then cast to char.

Prototypes are as follows

int isupper(int x);

int toupper(int y);
isupper in ctoupper in c
Checks whether a character is in uppercase or not.Converts lowercase letters to uppercase letters.
int isupper(int y);int toupper(int y);

Difference between isupper and islower in c

isupper function checks whether a character is in uppercase or not. islower function checks whether a character is in lowercase or not.

Prototypes are as follows

int isupper(int y);

int islower(int x);
isupper in cislower in c
Checks a given character is in uppercase or not.Checks a given character is in lowercase or not.
int isupper(int x);int islower(int y);

People also ask for

What is isupper in c?

isupper function checks whether a character is in uppercase or not. It is defined in ctype.h header file.