Server Side Programming Articles

Page 918 of 2109

Differentiate the modulo and division by using C Programming language?

Mandalika
Mandalika
Updated on 15-Mar-2026 6K+ Views

In C programming, the modulo and division operators are fundamental arithmetic operators that work with integers but produce different results from the same operands. Modulo (%) − Returns the remainder after integer division. Division (/) − Returns the quotient (whole number result) of integer division. Syntax result = dividend % divisor; // Modulo operation result = dividend / divisor; // Division operation Example 1: Basic Modulo and Division This example demonstrates the difference between modulo and division operators − #include int main() { ...

Read More

Write a C program to perform 3X3 matrix operations

Mandalika
Mandalika
Updated on 15-Mar-2026 2K+ Views

In C, we can perform various operations on a 3x3 matrix such as calculating row sums, column sums, and diagonal sums. This program demonstrates how to read a 3x3 matrix and compute these basic operations. Syntax int matrix[3][3]; // 3x3 matrix declaration // Row sum: matrix[i][0] + matrix[i][1] + matrix[i][2] // Column sum: matrix[0][j] + matrix[1][j] + matrix[2][j] // Main diagonal: matrix[0][0] + matrix[1][1] + matrix[2][2] // Anti-diagonal: matrix[0][2] + matrix[1][1] + matrix[2][0] Algorithm Step 1: Declare a 3x3 matrix Step 2: Read 9 numbers from user Step 3: Store numbers in ...

Read More

Write a C program of library management system using switch case

Mandalika
Mandalika
Updated on 15-Mar-2026 10K+ Views

A library management system in C allows you to store and manage book information efficiently. This program uses a structure to store book details and implements a menu-driven interface using switch-case statements for different operations. Syntax struct library { char bookname[50]; char author[50]; int noofpages; float price; }; Algorithm Step 1: Declare a structure to hold book data members Step 2: Declare variables for loop control and book counting Step 3: Use switch case to handle different ...

Read More

Write a C program for electing a candidate in Elections by calling functions using Switch case

Mandalika
Mandalika
Updated on 15-Mar-2026 5K+ Views

This C program demonstrates how to create an electronic voting system using functions and switch case statements. The program allows users to cast votes for candidates and view the vote count results. Syntax switch(expression) { case constant1: // statements break; case constant2: // statements break; default: ...

Read More

How to align the output using justificationsin C language?

Mandalika
Mandalika
Updated on 15-Mar-2026 21K+ Views

In C, justifications in printf() statements allow you to format and align output data in various ways. By using width specifiers and alignment flags, you can create well-formatted tables and organized output displays. Syntax printf("%-width format_specifier", value); // Left justification printf("%width format_specifier", value); // Right justification (default) To implement left justification, insert a minus sign (-) before the width value. Without the minus sign, the output is right-justified by default. Example 1: Left Justification with Fixed Width This example demonstrates left justification using %-15s for strings and %-15d ...

Read More

Write C program to calculate balance instalment

Mandalika
Mandalika
Updated on 15-Mar-2026 884 Views

In C programming, calculating loan balance installments involves computing the remaining amount after each monthly payment, considering compound interest. This program demonstrates how to calculate the outstanding balance after making monthly payments on a loan with interest. Syntax balance = principal + (principal * (interest_rate / 100) / 12); remaining_balance = balance - monthly_payment; Formula for Interest Calculation The monthly interest calculation follows this approach − Monthly Interest: principal * ((annual_rate / 100) / 12) Balance with Interest: principal + monthly_interest Remaining Balance: balance_with_interest - monthly_payment Example: Loan Balance Calculator ...

Read More

C program on calculating the amount with tax using assignment operator

Mandalika
Mandalika
Updated on 15-Mar-2026 3K+ Views

In C programming, calculating tax on an amount is a common application of arithmetic and assignment operators. This program demonstrates how to compute the total amount by adding a specific tax percentage to the original amount. Syntax total_amount = original_amount + (original_amount * tax_rate); Problem Write a C Program to enter the amount in dollars and then display the amount by adding 18% as tax. Solution Let's consider the restaurant person adding 18% tax to every bill of the customer. The logic applied to calculate tax is − value = ...

Read More

How to calculate the volume of a sphere using C programming language?

Mandalika
Mandalika
Updated on 15-Mar-2026 7K+ Views

The volume of a sphere is the amount of space enclosed within the sphere. In C programming, we can calculate this using the mathematical formula for sphere volume. Syntax volume = (4.0/3.0) * π * radius³ Where π (pi) ≈ 3.14159 and radius is the distance from the center to any point on the sphere's surface. Algorithm Step 1: Enter radius of sphere at runtime Step 2: Apply the formula to variable Volume = (4/3) * π * radius³ Step 3: Print the volume ...

Read More

Explain reference and pointer in C programming?

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

In C programming, pointers are variables that store memory addresses of other variables. C does not have references like C++ − it only has pointers for indirect access to variables. Syntax datatype *pointer_name; pointer_name = &variable_name; Pointers in C Pointers store the memory address of another variable They can hold NULL values They enable pass by reference functionality They can be declared without initialization Use * operator to access the value at the address (dereference) Use & operator to get the address of a variable Example: Basic Pointer Operations This ...

Read More

Limitations of C programming language

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

C programming language, despite being powerful and widely used, has several limitations when compared to modern programming languages. Understanding these limitations helps developers choose the right language for their projects. Key Limitations of C Programming 1. No Object-Oriented Programming Support C does not support object-oriented programming concepts like inheritance, polymorphism, encapsulation, and data abstraction. This makes it difficult to model real-world problems effectively. 2. No Runtime Error Detection C compiles the entire program before checking for errors, rather than detecting errors line by line. This can make debugging more challenging compared to interpreted languages. ...

Read More
Showing 9171–9180 of 21,090 articles
« Prev 1 916 917 918 919 920 2109 Next »
Advertisements