This happens when the programmers allocate memory to the heap for some temporary use and then forget to delete it
Continue readingCategory: C Programming
C program to enter integer elements and sort them in ascending order
#include <stdio.h> int main() { int arr[5],j,k,s=0; printf(“\n Enter five Elements :”); for(j=0;j<5;j++) { scanf(“%d”,&arr[j]); s=s+arr[j]; } printf(“Sorted elements are:\n”);
Continue readingWrite C Program to Find the First and Second Largest Two Numbers in a given Array
#include <stdio.h> #define MAX 5 int main() { int arr[MAX], i, larg1, larg2, temp; printf(“Enter %d the numbers \n”, MAX);
Continue readingWrite C program to insert an element at a specified position in a given array
#include <stdio.h> int main() { int arr[15]={0},i,n,pos,num; printf(“\n how many elements you want to enter:”); scanf(“%d”,&n); printf(“\n Enter the elements
Continue readingC program for binary search
#include <stdio.h> int main() { int c, low, up, mid, num, search, array[100]; printf(“how many number do want to enter\n”);
Continue readingWrite a Program to convert a decimal number to Binary, octal and hexadecimal number
#include <stdio.h> void main() { int dnum, choice; printf (“Enter a decimal number “) ; scanf(“%d”,&dnum) ; printf (“1.Binary\n 2.
Continue readingC program to print Armstrong numbers from 1 to 1000
#include<stdio.h> #include<conio.h> int main() { int num, n, cube, d, sum; printf(“Armstrong numbers are : \n”); for (num = 100;
Continue readingProgram to Convert a binary number to a decimal number
#include<stdio.h> #include<conio.h> int main() { int n, nsave, rem, d, j = 1, decimal = 0; printf(“Enter the number in
Continue readingProgram In C to find out the factorial of any number
#include<stdio.h> #include<conio.h> int main() { int n, num; long fact = 1; printf(“Enter the number :”); scanf(“%d”, &n); num =
Continue readingProgram In C to print the sum of digits of any number
#include<stdio.h> #include<conio.h> int main() { int n, sum = 0, rem; printf(“Enter the number : “); scanf(“%d “, &n); while
Continue reading