Server Side Programming Articles

Page 909 of 2109

C program for testing the character type

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 1K+ Views

In C programming, the ctype.h library provides predefined functions for analyzing and converting character types. These functions are essential for validating user input and performing character-based operations. Syntax #include int isalpha(int c); int isdigit(int c); int isspace(int c); int ispunct(int c); int islower(int c); int isupper(int c); int isalnum(int c); int tolower(int c); int toupper(int c); Analysis Functions The character analysis functions are listed below − Function Checks whether entered character is isalpha An alphabet or not isdigit A digit or not ...

Read More

C program to convert days into months and number of days

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 14K+ Views

In C programming, we can convert a total number of days into months and remaining days using simple arithmetic operations. This conversion assumes each month has 30 days on average. Syntax months = total_days / 30; remaining_days = total_days % 30; Algorithm The algorithm to convert days into months and remaining days is as follows − Step 1: Start Step 2: Declare variables for months, days, and total_days Step 3: Read total number of days from user Step 4: Calculate months using division months ...

Read More

Explain the concept of one and two dimensional array processing using C language

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 697 Views

Arrays in C programming are collections of elements of the same data type stored in contiguous memory locations. Array processing involves operations like reading, writing, and manipulating array elements. Let us explore one-dimensional and two-dimensional array processing. Syntax /* 1D Array Declaration */ datatype array_name[size]; /* 2D Array Declaration */ datatype array_name[rows][columns]; 1D Array Processing One-dimensional arrays store elements in a linear sequence. Here's how to read and write elements − Reading Elements into 1D Array int num[5]; int i; for(i=0; i

Read More

C Program to check the type of character entered

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 9K+ Views

In C programming, determining the type of a character involves checking whether the entered character is an uppercase letter, lowercase letter, digit, or special character. This can be accomplished by examining the ASCII value of the character and comparing it against specific ranges. Syntax if (character >= 'A' && character = 'a' && character = '0' && character = 65 && ch = 97 && ch = 48 && ch = 'A' && ch = 'a' && ch = '0' && ch

Read More

C program to find in which quadrant the coordinates lie.

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 1K+ Views

In C programming, determining which quadrant coordinates lie in is a fundamental problem in coordinate geometry. A coordinate system is divided into four quadrants based on the signs of the x and y coordinates. Syntax if (x > 0 && y > 0) // First quadrant else if (x < 0 && y > 0) // Second quadrant else if (x < 0 && y < 0) // Third quadrant else if (x > 0 && y < 0) // Fourth ...

Read More

C program to remove the brackets from a given input.

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 946 Views

In C programming, removing brackets from mathematical expressions is a common string manipulation task. This involves processing the expression to eliminate parentheses while maintaining the correct mathematical meaning, especially handling sign changes when brackets are preceded by a minus sign. Syntax char* removeBrackets(char expression[]); Algorithm The algorithm to remove brackets follows these steps − Step 1: Read the input expression string Step 2: Traverse each character in the string Step 3: Copy non-bracket characters to result string Step 4: When encountering '(' preceded by '-', flip signs inside brackets Step 5: Skip ...

Read More

C program to search an array element using Pointers.

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 16K+ Views

In this tutorial, we'll learn how to search for an element in an array using pointers in C. This approach demonstrates the power of pointer arithmetic and dynamic memory management for array operations. Syntax int search(int *array, int size, int element); // Returns: index if found, -1 if not found Algorithm Here's the step-by-step algorithm to search elements in an array using pointers − Step 1 − Declare and read the array size Step 2 − Input array elements Step 3 − Declare a pointer to traverse the array Step 4 − ...

Read More

Find the largest number in a series by using pointers in C language

Sindhura Repala
Sindhura Repala
Updated on 15-Mar-2026 5K+ Views

A pointer is a variable that stores the address of another variable. Instead of holding a value directly, it holds the memory address where the value is stored. Pointers use the dereferencing operator (*) to access the value and the address operator (&) to obtain memory addresses. In this tutorial, we'll learn how to find the largest number in a series using pointers in C programming. Syntax datatype *pointer_name; pointer_name = &variable_name; Where the asterisk (*) declares a pointer and the ampersand (&) gets the address of a variable. Algorithm Here's the ...

Read More

C program to sort an array by using merge sort

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 4K+ Views

Merge sort is a divide-and-conquer algorithm that recursively divides an array into two halves, sorts each half separately, and then merges the sorted halves back together. It guarantees O(n log n) time complexity in all cases. Syntax void MergeSort(int array[], int left, int right); void Merge(int array[], int left, int middle, int right); How Merge Sort Works The merge sort algorithm follows these steps − Divide: Split the array into two halves at the middle point Conquer: Recursively sort both halves Combine: Merge the two sorted halves into a single sorted array ...

Read More

C program to delete an array element using Pointers

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 4K+ Views

In C, deleting an element from an array involves shifting all subsequent elements one position to the left. This operation can be efficiently implemented using pointers to manipulate array elements directly through memory addresses. Syntax void deleteElement(int *array, int size, int position); // array: pointer to the array // size: current size of the array // position: 1-based position of element to delete Algorithm The algorithm to delete an element from an array using pointers − Declare and read the array size Allocate memory dynamically using malloc() Input array elements Read the ...

Read More
Showing 9081–9090 of 21,090 articles
« Prev 1 907 908 909 910 911 2109 Next »
Advertisements