Category: C program

python tutorials and learn python

Created with Sketch.

C Program to Add Two Integers

C Program to Add Two Integers In this program, user is asked to enter two integers. Then, the sum of those two integers is stored in a variable and displayed on the screen. Program to Add Two Integers #include <stdio.h> int main() { int firstNumber, secondNumber, sumOfTwoNumbers; printf(“Enter two integers: “); // Two integers entered…
Read more

C Program to Print an Integer (Entered by the User)

C Program to Print an Integer (Entered by the User) In this program, integer entered by the user is stored in a variable. Then, that variable is displayed on the screen using printf() function. Program to Print an Integer #include <stdio.h> int main() { int number; // printf() dislpays the formatted output printf(“Enter an integer:…
Read more

Program to Display “Hello, World!”

C “Hello, World!” Program A simple C program to display “Hello, World!” on the screen. Since, it’s a very simple program, it is often used to illustrate the syntax of a programming language. Program to Display “Hello, World!” #include <stdio.h> int main() { // printf() displays the string inside quotation printf(“Hello, World!”); return 0; }…
Read more