Display Maximum number in c

Algorithm: Start the programGet two numbers from userStored the numbers in num1 & num1If num1 is greater than num2 then num1 is maximum.Else num2 is greaterDisplay the maximum number in outputStop the program Program: #include <stdio.h>int main(){ int num1, num2; printf("Enter two numbers: "); scanf("%d%d", &num1, &num2); if(num1 > num2) { printf("%d is maximum", num1); … Continue reading Display Maximum number in c

C program for tower for hanoi

Algorithm: Start the programOnly one disk can be moved at a time.Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.No disk may be placed on top of … Continue reading C program for tower for hanoi

Arithmetic operations in C programming

ALGORITHM:      1. Start      2. Declare variables      3. Read the Inputs .      4. Calculate Arithmetic operations(+,-,*,/,pow) for the input of two numbers.      5. Display the output of the calculations .      6. Stop PROGRAM: #include <stdio.h> #include <conio.h> int main(){ int firstNumber, secondNumber; int sum, difference, product; long square; float quotient; … Continue reading Arithmetic operations in C programming