Category: C

C Program to find the Sum of natural numbers

Problem Write a program in C to find the sum of natural numbers using recursive function. How to find the sum of natural numbers using recursion in C ? Output Abundantcode.com Coding samples Enter the limit : 5 Result = 15

C Program to calculate the sum of Natural Numbers

Problem Write a program in C to take the input (n) from the user and calculate the sum of all the natural numbers from 1 to n. How to calculate the sum of natural numbers in C language ? Output Abundantcode.com coding sample                                                Enter a positive number : 4                                                 Result = 10

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 : 1                                                                                                                                                            Enter second number : 2                                                                                                                                                                  1 + 2 = 3

C Program #3

What is the output of the following C program? Output Compiler error: 11 8 [Error] expected ‘;’ before ‘m’ Although the C program in the above sentence appears to be syntactically correct, compilation fails. class name for the reason. The compiler must be informed that main is the name of the class since that is its name. To create an object of a class or…

C Program #1

What is the output of the following C program? Output 14 13 The output of the sizeof operator is 14, which is the size of the string including the null character. While the strlen() function returns a string that is exactly 13 characters long, excluding null characters.

C Program #2

What is the output of the below C program? Output Constructor is executed Destructor is executed The first line of the main () function appears strange, but it is entirely legitimate. In C++, an object can be created without having its handle assigned to any pointer. Without any pointers pointing at it, this statement will produce an object of the class Test.

C Program to display half-pyramid using numbers

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

C Program to find the version of C

In this post, you’ll learn how to find the version of C that is installed on your machine which you are using. C Program to find the version of C C comes in three different ISO versions: C90, C99, and C11. Check the following to see which C version your software is using:

C Program to find the ASCII Value of a Character

Problem Write a program in C to find the Ascii value of a character entered by the user and display the result on the screen. How to find the ASCII Value of a Character in C ? When the user enters the character A , the value 65 (Ascii value) should be displayed on the screen. Here’s a C program for it. Output Enter a…