Tag: C# programs
C Program to find if the input is a Armstrong Number or Not
Problem Write a program in C to find if a given number is Armstrong number or not. How to check if a number is a Armstrong number or not in C programming Language ? A given number is a Armstrong number of order n if abc… = an + bn + cn + … For example , 371 is a Armstrong number because the result…
C Program to calculate the power of a number
Problem Write a program in C to calculate and display the power of a number. How to calculate the power of a number in C ? Output Abundantcode.com coding sample Enter the base number: 2 Enter an exponent: 3 Answer = 6
C Program to insert an element into an array
Problem Statement Write a program in C to insert an element in to an array. C Program to insert an element into an array
C Program to display full pyramid using numbers
Problem Write a program in C to print full pyramid using numbers as shown below.The program should take the number of rows as input. 1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 How to create and display full pyramid pattern in C using numbers ? Output Abundantcode.com coding samples Enter the limit: 4…
C Program to find if the given number is a Strong Number or not.
Problem Statement You need to write a program in C to find if the given number is a strong number or not. How to find if the given number is a strong number ? What is a strong number ? A number is said to be a strong number when the sum of the factorial of a number’s individual digits are equal to the number…
C Program to find if the Given year is a Leap Year or Not
Problem Write a program in C to check whether a year entered by the user is a leap year or not. How to find if the given Year is a Leap Year or Not in C ? If the Year is divisible exactly by 4 , then it is a Leap Year. Additionally for the century years that ends with 00 , it is a…
C Program to compare arrays
Problem Statement You need to write a program in C to compare two arrays of characters and display if they are equal or not. How to compare two arrays in C ?
C# Program to display "Hello, World!"
Problem Write a program in C# to display “Hello, World!” on the screen. C# Program to display “Hello, World!” in Console Window. This is a simple C# program that displays “Hello, World!” on the console window. Output Hello, World!
C Program to display Fibonacci Numbers
Problem Write a program in C to display the sequence of Fibonacci numbers of first n numbers entered by the user. How to display Fibonacci sequence in C Language ? Before writing a program to display the Fibonacci sequence , it is important to understand what exactly is the Fibonacci sequence. It is a series where the next number is the sum of the previous…
C Program to find if a number is odd or even using Conditional Operator
Problem Write a program in C language using the conditional operator to check whether a given number is even or odd. How to check if a Number is Odd or Even in C using conditional operator? An integer that is divisible by 2 is an even number and that is not divisible by 2 is an odd number. Example of even number is 2 ,…
C Program to check number is perfect number or not
Problem Statement Write a program in C to find if the given number is a perfect number or not. A number is said to be a perfect number if it is a positive number and when the sum of its divisors are equal to the number. How to find if the number is a perfect number or not ?
C Program to check if a input number is a prime number or not
Problem Write a program in C to check whether a number is a prime number or not. How to find if a number is a prime number in C ? A Prime Number is a number that is divisible by 1 and by itself. Some of the examples of the prime number are 2 , 3 , 5 etc. Here’s a program in C demonstrating…
C Program to Swap two Numbers
Problem Write a program in C language to swap two numbers using a temporary variable and display the result in the screen. How to Swap two numbers in C using a temporary variable? Output Abundantcode – Swap two numbers using temporary variable Enter First Number: 1 Enter Second Number: 7 FirstNumber = 7.00 SecondNumber = 1.00
C Program to count the number of digits in an Integer
Problem Write a program in C to cound the number of digits in an integer that was entered by the user. How to count the number of digits in an integer in turbo C ? Output Abundantcode.com Coding sample Enter an integer: 50102 Number of digits: 5
C program to compare 2 numbers using ternary operator
Problem Statement Write a program in C to compare 2 numbers without using if statement but instead use the ternary operator. C program to compare 2 numbers using ternary operator
C# Program to add two integers
Problem Write a program in C# to add two integers and display the result on the screen. C# Program to add two integers Output Enter the first number1 Enter the second number2 result 3
C Program to check if a number is odd or even
Problem Write a program in C language to check whether a given number is even or odd. How to check if a Number is Odd or Even in C ? An integer that is divisible by 2 is an even number and that is not divisible by 2 is an odd number. Example of even number is 2 , 4, 12 etc. Example of an…
C Program to Swap two Numbers without using temporary variable
Problem Write a program in C language to swap two numbers without using temporary variable and display the result in the screen. How to Swap two numbers in C without using temporary variable? Output Abundantcode – Swap two numbers without using temporary variable Enter First Number: 1 Enter Second Number: 7 FirstNumber = 7.00 SecondNumber = 1.00
C Program to find the simple and compound interest
Problem Statement You need to find the simple and the compound interest for the given principal , time and rate of interest. How to find the simple and compound interest in C ?
C Program to find the LCM of two numbers
Problem Write a program in C to find the LCM(Lowest common multiples) of the two numbers given by the user. How to find the LCM of two numbers in C ? Lowest common multiples of two integers refers to the smallest numbers that is perfectly divisble by both the numbers given as input where the value of the remainder is zero. Here’s a program in…