Bhanu Priya

Bhanu Priya

1,061 Articles Published

Articles by Bhanu Priya

Page 53 of 107

Explain monolithic and modular programming in C language

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

Monolithic and modular programming are two different approaches to writing C programs. The main difference lies in how the code is organized and structured. Monolithic Programming In monolithic programming, the entire program logic is written in a single function, typically the main() function. All the code is placed in one location without breaking it into smaller, manageable parts. Example: Monolithic Approach Here's an example of a monolithic program that performs arithmetic operations − #include int main() { int a = 10, b = 5; ...

Read More

How to display the complete text one word per line in C language?

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

In C, displaying text one word per line involves reading words from a file and printing each word on a separate line. This can be accomplished by using file handling functions to read words and format the output appropriately. Syntax fscanf(file_pointer, "%s", word_buffer); printf("%s", word); Example: Reading Words from File The following program demonstrates how to display text one word per line by reading from a file − Note: This example uses file operations. Create a text file named "input.txt" with some text content before running the program. #include ...

Read More

C program to convert upper case to lower and vice versa by using string concepts

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

Converting uppercase letters to lowercase and lowercase letters to uppercase is commonly known as case toggling. In C programming, we can achieve this using ASCII values or built-in character functions. Syntax // Manual approach using ASCII values if (ch >= 'a' && ch = 'A' && ch = 'a' && string[i] = 'A' && string[i]

Read More

C program to verify if the numbers are abundant(friendly) or not?

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

In C programming, abundant numbers (also called friendly numbers) are special numbers where the sum of their proper divisors equals the number itself. Two numbers form an abundant pair if both numbers are abundant individually. Syntax // Find sum of proper divisors for(i = 1; i < number; i++) { if(number % i == 0) { sum = sum + i; } } // Check if abundant if(sum == number) { // Number is abundant } ...

Read More

Explain Squeeze Function C language

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

The squeeze() function in C is a user-defined function that removes all characters from the first string that are present in the second string. This function is particularly useful for filtering characters based on a reference string. Syntax void squeeze(char string1[], char string2[]); Parameters string1[] − The source string from which characters will be removed string2[] − The reference string containing characters to be removed from string1 How It Works The squeeze function works by scanning each character in the first string and checking if it exists in the second ...

Read More

Write a C program to display all datatypes ranges in tabular form

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

In C programming, data types define the type and range of values that can be stored in variables. This program displays all fundamental data types with their minimum and maximum ranges in a tabular format using the limits.h header file. Syntax #include #include // Use predefined constants like INT_MIN, INT_MAX, FLT_MIN, FLT_MAX Primary Data Types C supports four fundamental data types − Integer − Stores whole numbers (int, short, long) Character − Stores single characters (char) Floating-point − Stores decimal numbers (float) Double precision − Stores high-precision decimal numbers (double) ...

Read More

What are the shift operations in C language?

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

Shift operations in C are bitwise operators that move bits of a number left or right. These operations are fundamental for bit manipulation and can be used for efficient multiplication and division by powers of 2. Syntax variable > n // Right shift by n positions ~variable // Bitwise complement (NOT operation) Left Shift Operation The left shift operator () moves bits to the right by specified positions. Each right shift by one position halves the value (for positive numbers). ...

Read More

How to count number of vowels and consonants in a string in C Language?

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

In C programming, counting vowels and consonants in a string is a common string manipulation task. We iterate through each character and check if it's a vowel (a, e, i, o, u) or consonant using conditional statements. Syntax // Check if character is vowel if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') vowels++; else if(isalpha(ch)) ...

Read More

C program to print multiplication table by using for Loop

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

A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times. In this tutorial, we will learn how to print a multiplication table using a for loop in C. Syntax for (initialization; condition; increment/decrement) { // statements to be executed } Algorithm Given below is an algorithm to print multiplication table using for loop in C language − Step 1: Enter a number to print table at runtime. Step 2: Read that number from keyboard. Step 3: Using for loop print number*i 10 times. // for(i=1; i

Read More

How to write a simple calculator program using C language?

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

A calculator is a simple tool that helps us to calculate mathematical operations easily and quickly. A basic calculator can perform simple arithmetic operations like subtraction, addition, multiplication, and division. In C programming, we can create a calculator using switch-case statements to handle different operators and perform calculations based on user input. Syntax switch(operator) { case '+': result = num1 + num2; break; case '-': result = num1 - num2; break; case '*': result = num1 * num2; break; case ...

Read More
Showing 521–530 of 1,061 articles
« Prev 1 51 52 53 54 55 107 Next »
Advertisements