Tag: C# programs

C Program to display inverted full pyramid using *

Problem Write a program in C to print inverted full pyramid using * as shown below.The program should take the number of rows as input. * * * * * * *     * * * * *       * * *         * How to create and display inverted full pyramid using * ? Output Abundantcode.com Coding samples Enter number of rows: 4 *…

C Program to find if a character is a Vowel or Consonant

Problem Write a program in C to check whether a given character is a vowel or consonant. How to check if a character is a vowel or consonant in C Language ? In English , the alphabets A, E, I, O and U are vowels and the rest of the characters are consonants. Here’s a program that takes an input character from the user and…

C Program to Multiply two Floating Point Numbers

Problem Write a program in C to multiply two floating point numbers and then display the output on the console window. C Program to Multiply two Floating Point Numbers Output Enter two numbers: 6 7                                                                                                                                                        Product = 42.00

C Program to display Inverted half-pyramid using *

Problem Write a program in C to print Inverted half-pyramid using * as shown below.The program should take the number of rows as input. * * * * * * * * * * How to create and display Inverted half-pyramid pattern in C using * ? Output Abundantcode.com Coding samples Enter the limit : 4 * * * * * * * * *          …

C Program to display Inverted half-pyramid using numbers

Problem Write a program in C to print Inverted half-pyramid using numbers as shown below.The program should take the number of rows as input. 1 2 3 4 1 2 3 1 2 1 How to create and display Inverted half-pyramid pattern in C using numbers ? Output Abundantcode.com Coding samples Enter number of rows: 4 1 2 3 4 1 2 3          1 2           …

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 first number : 8                                                                                                                                                            Enter second number : 2                                                                                                                                                                  8 + 2 = 10

C Program to find the Factorial of a Given Number

Problem Write a program in C programming language to find the factorial of a given number and display it on the screen. How to find the factorial of a Number in C? The factorial of a number is generally specified as follows N! = 1*2*3*4… N This applies only for the positive number. The factorial of 0 is considered to be 1. Here’s a program…

C program to reverse a number

Problem Write a program in C to display the reverse of a number. The below program takes the input from the user in the form of an integer number and uses the while loop until the number becomes o. How to reverse a number in C ? Output Abundantcode.com coding sample Enter a number: 786543 Reverse Number = 345687

Undefined reference to `pow’ when compiling C program

When trying to make a simple program in C and compiling it , there are times when you might get an error that you are missing the pow function when you have used them inspite of including the math.h header file. The error message looks like this. undefined reference to ‘pow’ collect2: error: ld returned 1 exit status How to fix the error undefined reference…

C Program to display half-pyramid using alphabets

Problem Write a program in C to print half-pyramid using alphabets as shown below.The program should take the number of rows as input. A B B C C C D D D D How to create and display half-pyramid pattern in C using alphabets ? Output Abundantcode.com Coding samples Enter the limit : 4 A BB CCC DDDD

C Program to find GCD of two numbers

Problem Write a program in C to find the GCD of two numbers. How to find the GCD of two numbers in C ? GCD of two numbers refers to the largest integer value that can exactly divide both the number where the remainder is zero. Here’s a program in C demonstrating this. Output Abundantcode.com Coding Sample                                              Enter first Number: 24                                                Enter second Number: 18                                              …

C Program to display full pyramid using *

Problem Write a program in C to print full pyramid using * as shown below.The program should take the number of rows as input.         *       * * *     * * * * *   * * * * * * * How to create and  display full pyramid pattern in C using * ? Output Abundantcode.com Coding samples Enter the limit: 4…

C Program to check if a Number is Positive or Negative

Problem Write a program in C to check whether a input number is a positive or negative number. How to check if a number is positive or negative in C ? Output Abundantcode.com coding samples                                                  Enter a number: 7                                                      The entered number is a positive number.

C Program to print a Half Pyramid using *

Problem Write a program in C to print Half pyramid using * as shown. * * * * * * * * * * * * * * * How to create and display Half Pyramid pattern in C ? Output Abundantcode.com Coding samples Enter the total number of rows: 5 * * * * * * * * * * * * * *…

C Program to find the factorial of a number using Recursive function

Problem Write a program in C to find the factorial of a number using recursion and display the result. How to find the factorial of a number using recursion in C ? The Formula to find the factorial of a number (n) is (n!) = 1*2*3*4….n Here’s a C program to demonstrate this. Output Abundantcode.com Coding samples Enter a Number : 5 Factorial of 5…

C Program to find if the input character is an Alphabet or not

Problem Write a program in C to check whether the character that was entered by the user is a alphabet or not. How to find if the input character is an alphabet or not in C ? Output Abundantcode.com Coding sample                                               Please enter a character: A                                              A is an alphabet.