Mandalika has Published 475 Articles

Using iterative function print the given number in reverse order in C language

Mandalika

Mandalika

Updated on 05-Mar-2021 10:24:49

236 Views

ProblemHow to print the given in reverse order with the help of iterative function i.e., while loop using C programming language?SolutionSo far, we had seen how to reverse the string using string function and without string function, now let’s see how to reverse a number without using predefined function −AlgorithmInput ... Read More

Printing the numbers in reverse order using Division and modulo operators using C

Mandalika

Mandalika

Updated on 05-Mar-2021 10:21:24

911 Views

ProblemHow to print the given two-digit number in reverse order with the help of division and Modulo operator using C programming language?SolutionSo far, we had seen how to reverse the string using string function and without string function. Now let’s see how to reverse the two-digit number without using the ... Read More

Differentiate the modulo and division by using C Programming language?

Mandalika

Mandalika

Updated on 05-Mar-2021 10:04:59

4K+ Views

Modulo − Represents as % operator. And gives the value of the remainder of an integer division.Division − represents as / operator. And gives the value of the quotient of a division.Program 1#include int main(){    int a, b, c;    printf("enter a, b, c values:");    scanf("%d%d%d, &a, &b, &c);   ... Read More

Write a C program to perform 3X3 matrix operations

Mandalika

Mandalika

Updated on 05-Mar-2021 10:01:49

2K+ Views

ProblemEnter any 9 numbers at runtime and add the numbers in a row, column, and diagonal wise by using C Programming languageAlgorithmStep 1: Declare 9 variables Step 2: enter 9 numbers at runtime Step 3: store the numbers in 3 X 3 matrix form         //x y ... Read More

Write a C program of library management system using switch case

Mandalika

Mandalika

Updated on 05-Mar-2021 09:57:47

7K+ Views

ProblemHow to store the books-related information of library using C programming.AlgorithmStep 1: Declare a structure which holds data members Step 2: declare variables which are used for loop Step 3: use switch case to work on each module Step 4: case 1- for Adding book information         ... Read More

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

Mandalika

Mandalika

Updated on 05-Mar-2021 09:30:26

4K+ Views

ProblemHow to cast vote, count, and display the votes for each candidate that participates in elections using C language?SolutionLet’s consider three persons who participated in elections. Here we need to write a code for the following −Cast vote − Selecting a candidate by pressing the cast voteFind vote count − ... Read More

How to align the output using justificationsin C language?

Mandalika

Mandalika

Updated on 05-Mar-2021 08:46:09

14K+ Views

By using justifications in printf statement we can arrange the data in any format.Right JustificationTo implement the right justification, insert a minus sign before the width value in the %s character.printf("%-15s", text);Program 1Let’s take an example to print data in row and column-wise with the help of justification. Live Demo#include int main(){ ... Read More

Write C program to calculate balance instalment

Mandalika

Mandalika

Updated on 05-Mar-2021 08:40:51

574 Views

ProblemWrite a C program to calculate a balance installment that is to be paid after every month for a particular loan amount (with interest).SolutionFollowing is the formula to calculate interest when the loan amount is given −i=loanamt * ((interest/100)/12);Following calculation gives amount with interest −i=i+loanamt; firstmon=i-monthlypayment; //first month payment with ... Read More

C program on calculating the amount with tax using assignment operator

Mandalika

Mandalika

Updated on 05-Mar-2021 08:38:24

2K+ Views

ProblemWrite a C Program to enter the amount in dollars and then display the amount by adding 18% as tax.SolutionLet’s consider the restaurant person adding 18% tax to every bill of the customer.The logic applied to calculate tax is −value=(money + (money * 0.18));The money should be multiplied by 18% ... Read More

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

Mandalika

Mandalika

Updated on 05-Mar-2021 08:35:37

3K+ Views

The volume of sphere is nothing but the capacity of the shape.Volume of a sphere formula is −$$V\:=\:\frac{4}{3}\Pi\:r^{3}$$AlgorithmStep 1: Enter radius of sphere at runtime Step 2: Apply the formula to variable         Volume=(4/3)*3.14*rad*rad*rad Step 3: print the volume Step 4: stopProgram 1 Live Demo#include int main(){   ... Read More

Advertisements