Basic Programs C Program to Check if a given Integer is Positive or Negative In this c program, you will learn about how to pass an integer value and check if it’s positive or negative. To start with you need to define an integer variable with the name num. By using scanf we will take integer value with representation %d. With the help of if-else condition, we will check […]
Basic Programs C Program to Check if a given Integer is Odd or Even In the below C program we will check if a given integer is odd or even. In order to do so, we will take a single integer value as an input and then we will divide it with two, if the remainder results in zero, it means it is an even number else it is […]
Basic Programs C Program to calculate the sum of odd and even numbers in C In this program, we will calculate the sum of odd and even numbers in C, for that we will take a maximum value as input from the user. Starting from 1 we will run a for loop with increment by 1 and check if the number is even or odd. We will also create two […]
Basic Programs C Program to Read Two Integers M and N & Swap their Values using functions and pointers Swapping refers to the interchange of the values of two. In this C program, we will use the following features – Functions Float Pointers We will take two floating variables from the user and pass them to a function swap() as a reference. We will use a temp variable inside the function and then swap […]
C Programs Basic Programs C Program to Find the Number of Integers Divisible by 5 and their sum In this program, we will ask the user to provide the minimum value and a maximum value range to be added and find integers divisible by 5 and a total of those integers. To find integers divisible by 5, we will first start a for loop with variable i, which is the minimum value N1 […]
Basic Programs C Program to Accept two integers and Check if they are equal In this C program we are accepting two integers using scanf and comparing both the input integer value and comparing them if they are equal or not using if-else. If the integer value are equal we will receive output Number1 and Number2 are equal. Otherwise the output will say Number1 and Number2 are not equal. #include void main() […]