(C programming Example for Beginners) C Program to Make a Simple Calculator Using switch…case In this example, you will learn to create a simple calculator in C programming using the switch statement. This program takes an arithmetic operator +, -, *, / and two operands from the user. Then, it performs the calculation on the two operands …
Day: March 18, 2021
(C programming Example for Beginners) C Program to Display Factors of a Number In this example, you will learn to find all the factors of an integer entered by the user. This program takes a positive integer from the user and displays all the positive factors of that number. Factors of a Positive Integer #include …
(C programming Example for Beginners) C Program to Check Armstrong Number In this example, you will learn to check whether an integer entered by the user is an Armstrong number or not. A positive integer is called an Armstrong number (of order n) if abcd… = an + bn + cn + dn + In the …
(C programming Example for Beginners) C Program to Display Prime Numbers Between Two Intervals In this example, you will learn to print all prime numbers between two numbers entered by the user. Display Prime Numbers Between Two Intervals #include <stdio.h> int main(){ int low, high, i, flag; printf(“Enter two numbers(intervals): “); scanf(“%d %d”, &low, &high); …
(C programming Example for Beginners) C Program to Reverse a Number In this example, you will learn to reverse the number entered by the user. Reverse an Integer #include <stdio.h> int main(){ int n, rev = 0, remainder; printf(“Enter an integer: “); scanf(“%d”, &n); while (n != 0) { remainder = n % 10; rev …
(C programming Example for Beginners) C Program to Count Number of Digits in an Integer In this example, you will learn to count the number of digits in an integer entered by the user. This program takes an integer from the user and calculates the number of digits. For example: If the user enters 2319, …