Author: ayesha

Convert a Decimal Number to Binary in C

Let’s understand how to Convert a Decimal Number to Binary in C Programming Language. C Program to Convert a Decimal Number to Binary #include <stdio.h> /*Learn C Programming at CodeAtGlance.com*/ void main() {  long num, dec, rem, temp = 1, binary = 0, count = 0;    printf(“Enter a decimal integer \n”);    scanf(“%ld”, &num);    […]

Convert the Binary Number into Decimal In C

In this tutorial, we will learn how to convert the binary number to the decimal using C Programming Language. C Program to Convert the given Binary Number into Decimal #include <stdio.h> /*Learn C Programming at CodeAtGlance.com*/ void main() {    int  num, B_value, D_value= 0, base = 1, r;    printf(“Please enter a binary number(1s and […]

Count Positive and Negative Numbers in an Array in C

Count Positive and Negative Numbers in an Array in C #include<stdio.h> int main() { int SizeOfArray, i, a[10]; int PositiveCounter  = 0, NegativeCounter  = 0;   printf(“\n Please Enter the SizeOfArray of an Array :  “); scanf(“%d”, &SizeOfArray);   printf(“\nPlease Enter the Array Elements\n”); for(i = 0; i < SizeOfArray; i++) {      scanf(“%d”, &a[i]); }  […]

Sum of Even and Odd Numbers in a Given Range in C

In this C Programming tutorial, we will learn how to write Sum of Even and Odd Numbers in a Given Range in C. Sum of Even and Odd Numbers in a Given Range in C #include<stdio.h> /* Learn C Programming at www.Codetaglance.com */ int main() { int i, Min, Max, SumEven = 0, SumOdd = […]

Sum of N Numbers Program In C: Using Recursion

This C Program to find the sum of n numbers using the Recursion we will calculate the sum of N natural Numbers. C Program to find Sum of N Numbers using Recursion #include<stdio.h> /* Learn C Programming at www.Codetaglance.com */ int Sum_Recursion(int Number); int main() { int Number, Sum = 0; printf(“\n Enter an Integer Value\n”); […]

Sum of N Numbers Program In C: Using Functions

This Sum of N numbers program in C Programming allows the user to enter N integer by using the function. C Program To Find Sum of N Numbers Using Functions #include<stdio.h> /* Learn C Programming at www.Codetaglance.com */ int Sum_Functions(int N); int main() { int N, i, Sum = 0; printf(“\nPlease Enter any Integer of […]

Sum of N numbers program in C: Using While Loop

Let’s discuss the program for sum of N numbers in C Programming Language using the While Loop. C Program to find Sum of N Numbers using While Loop #include<stdio.h> //Learn C Programming at codeatglance.com int main() { int Num, i = 1, Sum = 0; printf(“\nEnter any Integer Value\n”); scanf(“%d”, &Num); while(i <= Num) { […]

Sum of N numbers program in C: Using for loop

In this article, we will learn how to write the Sum of N numbers program in C. C Program to find Sum of N Numbers #include<stdio.h> int main() { int Number, i, Sum = 0; printf(“\nPlease Enter any Integer Value\n”); scanf(“%d”, &Number);   for(i = 1; i <= Number; i++) {     Sum = Sum + […]

Sum of two numbers program in C

Do you want to find the Sum of two numbers program in C programming Language? Here is the Program you can try! Find the sum of two numbers: C Program #include<stdio.h> /*Learn C Programming at CodeAtGlance.com: Sum of two numbers program in C*/ int main() {   int num1, num2, sum;   printf(“\nEnter two numbers: […]