×

Float in islower() in C

Introduction: This article briefly discusses the float in islower() in C. The islower() function checks if the input character passed inside the function is lowercase. Lowercase letters include (a-z). The islower() function is defined in the ctype.h header file. 

Syntax of the float in islower() function in C: The syntax of the islower() function in C language is given below –

int islower(int c);

Parameter of the float in islower() function in C: The parameter of the islower() function is c. This is the character to check for. Only one parameter is required. c represents the character that should be checked.

Return value of the float in islower() function in C: After using the islower() function, it can return two possible values. This function returns non-zero (true) if c is lowercase and zero (false) otherwise. They can be - 

 Non-zero values: If the character passed to the islower() function is lowercase; a non-zero value is returned.

 0: If the character is not lowercase, the function returns zero (0).

Header file of the float in islower() function in C: The header file of the islower() function in C is ctype.h header file.

Implementing the islower() function in C programming: The islower() function in the C program checks whether characters are entered in lowercase rather than uppercase. Returns a non-zero number only if the character is one of a to z.

 This function is declared in the ctype.h header file. The islower() function definition is in this file, so you need to include this header file to use this function. For each character, the islower() function returns a non-zero value. 

Example is:

If the input value is ‘A,’ then the output value is 0. When the input value is ‘p’, the output is a non-zero value. If the input value is a unique character like ‘#,’ then the result is 0.

Algorithm of the islower() function in C: Here, we discuss the algorithm of the islower() function in C.

Step 1: At first, Initialize 0 as a counter variable.

Step 2: First, transverse the string individually.

Step 3: Make sure that every person of the string is handed into the islower() function.

Step 4: Increment the value of the counter fee utilizing one each time a non-zero value is returned using the islower() feature.

Step 5: Use the break() declaration to pop out of the loop while the conditions have encountered the null individual. The only disadvantage of this method is that the string must contain precisely one null value on the end.

Step 6: Returns the cost of a counter representing the wide variety of lowercase characters in a string. Print the fee within the most important function.

Example 1: We give the example of the islower() function is C. The example is given below.

#include <stdio.h>
#include <ctype.h>
int main()
{
char ch;
printf (“Enter a character value: ”);
scanf (“%c”, &ch);
if (islower(ch) == 0)
printf (“The given character %c is not a lowercase alphabet”, ch);
else
printf (“The given character %c is a lowercase alphabet”, ch);
return 0;
}

Output: We compile the above program and also run it. The result is given below –

Enter a character value: r
The given character r is a lowercase alphabet

Example 2: We give another example of an islower() function is C. The example is given below.

#include <stdio.h>
#include <ctype.h>
int main (int argc, const char * argv[] )
{
int letter;
letter = ‘p’;
if (islower(letter)) printf (“%c is lowercase character\n”, letter);
else 
printf (“%c is uppercase character\n”, letter);
letter = ‘R’;
if (islower(letter)) printf (“%c is lowercase character\n”, letter);
else 
printf (“%c is uppercase character\n”, letter);
return 0;
}

Output: We compile the above program and also run it. The result is given below –

p is a lowercase character
R is an uppercase character

Example 3: We give another example of an islower() function is C. The example is given below.

#include <stdio.h>
#include <ctype.h>
int main ()
{
 int char1 = 'P';
 int char2 = 'p';
 int char3 = '5';
 if (islower(char1))
{
 printf("char1 = %c is lowercase character\n", char1 );
} 
else 
{
printf("char1 = %c is not lowercase character\n", char1 );
 }
if (islower(char2))
{
printf("char2 = %c is a lowercase character\n", char2 );
} 
else 
{   
printf("char2 = %c is not lowercase character\n", char2 );
 }
  If (islower(char3)) 
{ 
printf("char3 = %c is a lowercase character\n", char3 );
 } 
else 
{
 printf ("char3 = %c is not a lowercase character\n", char3 );
 }
 return 0;
}

Output: We compile the above program and also run it. The result is given below –

char1 = P is not a lowercase character
char2 = p is a lowercase character
char3 = 5 is a not lowercase character

So, here we briefly discuss the islower() function in C. We also share the parameter, return value, syntax, header file, etc. And lastly, give some examples to clarify this topic. 


Related Topics

Fibonacci series program in C using Recursion

In this tutorial, we’ll explore how to utilise recursion to build the Fibonacci sequence in C language. What does the term "Fibonacci Series" mean? The following number in a Fibonacci number series is...

2 minutes read.

Malloc function in C

When the user or programmer does not know how much memory space is needed in the application, it a needs dynamic memory allocation during runtime. Dynamic memory allocation helps us to...

4 minutes read.

Function in C

Function is a group of statements that are used to perform any task. In other words, we can say that a function is a self- contained a block of programs...

3 minutes read.

Types of Array in C

What is an Array? One value can be stored in a variable at once. How many variables will you need if you have 100 values? Well, the answer isn't 100. It...

14 minutes read.

Entry Control Loop in C

Initially, an entry control loop verifies the termination condition at the entry point. After that, its control passes to the main body of the while or for loop if the...

3 minutes read.

C/C++ Program to Find the Size of int, float, double and char

In this tutorial, we will learn how to use the sizeof operator to determine the size of each variable. Program to Determine Variable Size Write a C or C++ program to determine the...

2 minutes read.

How to Avoid Structure Padding in C

Generally, when an object of some structure type is declared, some contiguous memory will be allocated in block form, which will be allocated to structure members. To understand structure padding...

3 minutes read.

Garbage in C

Garbage in C The C programming language is a perfect fit for embedded systems as it provides low level control, structured programming, and portability. On the contrary, it does not provide...

3 minutes read.

Queue implementation in C

In the C programming language, the queue is the abstract concept that is similar to stacks. However, it is the part of the data structures that work opposite to that...

4 minutes read.

How to include graphics.h in C?

How to include graphics.h in code blocks? Graphics .h is a header that allows drawing lines, rectangles, ovals, arcs, polygons, pictures, and strings on a graphical window by giving access to...

6 minutes read.

Assert() Function in C

Assert (): In C, the statements are executed with the exit statement. In C language declare, and it tests the condition parameters. If the statement executed will be false, it shows...

4 minutes read.

Modulus on Negative Numbers in C

In this tutorial, we will explore some examples of modulus on negative number. What is Modulus of Negative number? By omitting the minus sign, one can determine the modulus of a negative...

3 minutes read.

C Token

C Token and Keyword The C tokens are the basic buildings blocks in C language which are constructed together to write a C program. Each and every smallest individual unit in the C program is...

2 minutes read.

#define in C

#define in C In the C programming language, the preprocessor directive acts an important role within which the #define directive is present that is used to define the constant or the...

3 minutes read.

Long int in C

We use data type to avoid the type of data to be stored for a variable at the time of declaration.So, we can say that the variable type is known...

3 minutes read.

Runtime vs compile time in C

In the C programming language, the often used terms in every step consist of compile time and runtime. The compile time is referred to the source code that will be...

4 minutes read.

Static function in C

The functions in the C programming language are by default global. This means the programmer can easily access the function which is outside from the file where it was initially...

3 minutes read.

Diffie-Hellman Algorithm in C

Background: A method of public-key encryption known as elliptic curve cryptography (ECC) is based on the algebraic structure of elliptic curves over finite fields. To ensure equal security, ECC encryption requires fewer...

4 minutes read.

Bigint (BIG INTEGERS) in C with Example

The maximum number of digits that a long, long int can have in C/C++ is 20. The issue is how to store the 22-digit number, which is difficult to do...

9 minutes read.

Character Set in C

Introduction Every language has some basic elements which are used to represent information. The English language includes alphabets which together shape a sentence, after which the sentences are used to shape...

3 minutes read.