C Program to Print names of all Files present in a Directory

C Program to Print names of all Files present in a Directory

C Program to Print names of all Files present in a Directory dirent.h header file contains variables and functions related to directory streams. #include<stdio.h> #include<dirent.h> int main(void) { DIR *d; struct dirent *dir; d = opendir(“.”); if (d) { while ((dir = readdir(d)) != NULL) { printf(“%s\n”, dir->d_name); } closedir(d); } return(0); } Output: testFile1.txt testFile2.txt … Read more

C Program to Swap Two Numbers using Pointers

Selection-sort-swapping

C Program to Swap Two Numbers using Pointers #include<stdio.h> int main() { printf(“\n\n\t\tEduguru – C Program Example\n\n\n”); int a, b; int *ptra, *ptrb; int temp; printf(“Enter value for a: “); scanf(“%d”, &a); printf(“\n\nEnter value for b: “); scanf(“%d”, &b); printf(“\n\nThe values before swapping are: a = %d b = %d”, a, b); ptra = &a; … Read more

C Program for Dynamic Memory Allocation using malloc()

C Program for Dynamic Memory Allocation

C Program for Dynamic Memory Allocation using malloc() Below is a program on dynamic memory allocation using malloc() and clearing out memory space using free(). sizeof() returns the number of bytes occupied by any datatype, in this case by an integer. #include <stdio.h> int main() { printf(“\n\n\t\tEduguru – C Program Example\n\n\n”); int n, i, *ptr, sum = 0; printf(“\n\nEnter … Read more

Basic C Program for Pointers

basic program of pointer

Basic C Program for Pointers #include <stdio.h> int main() { printf(“\n\n\t\tEduguru – C program example\n\n\n”); int var = 24; // actual variable declaration int *p; p = &var; // storing address of int variable var in pointer p printf(“\n\nAddress of var variable is: %x \n\n”, &var); // address stored in pointer variable printf(“\n\nAddress stored in … Read more

C Program to find Deteminant of 2×2 Matrix

matrix program in c

C Program to find Deteminant of 2×2 Matrix #include<stdio.h> int main() { printf(“\n\n\t\tEduguru – C Program example\n\n\n”); int a[2][2], i, j; long determinant; printf(“\n\nEnter the 4 elements of the array\n”); for(i = 0; i < 2; i++) for(j = 0; j < 2; j++) scanf(“%d”, &a[i][j]); printf(“\n\nThe entered matrix is: \n\n”); for(i = 0; i … Read more

C Program to perform addition and subtraction of Matrices

C Program to perform addition and subtraction of Matrices

C Program to perform addition and subtraction of Matrices #include<stdio.h> int main() { printf(“\n\n\t\Eduguru- C Program example\n\n\n”); int n, m, c, d, first[10][10], second[10][10], sum[10][10], diff[10][10]; printf(“\nEnter the number of rows and columns of the first matrix \n\n”); scanf(“%d%d”, &m, &n); printf(“\nEnter the %d elements of the first matrix \n\n”, m*n); for(c = 0; c … Read more

C Program to check whether a two dimensional array is a Sparse Matrix

C Program to check whether a two dimensional array is a Sparse Matrix

C Program to check whether a two dimensional array is a Sparse Matrix A Sparse Matrix is a matrix(two-dimensional array) in which number of 0’s is greater than the number of non-zero elements. #include<stdio.h> int main() { printf(“\n\n\t\Eduguru- C program example\n\n\n”); int n, m, c, d, matrix[10][10]; int counter = 0; printf(“\nEnter the number of … Read more

Simple Program to remove Duplicate Element in an Array

Simple Program to remove Duplicate Element in an Array

Simple Program to remove Duplicate Element in an Array   #include<stdio.h> #include<conio.h> void main() { int a[20], i, j, k, n; clrscr(); printf(“\nEnter array size: “); scanf(“%d”, &n); printf(“\nEnter %d array element: “, n); for(i = 0; i < n; i++) { scanf(“%d”, &a[i]); } printf(“\nOriginal array is: “); for(i = 0; i < n; … Read more

Bihar Board 10th Result 2020 आज बीएसईबी बिहार बोर्ड मैट्रिक रिजल्ट

bihar board result

Bihar Board 10th Result 2020 आज बीएसईबी बिहार बोर्ड मैट्रिक रिजल्ट Bihar Board 10th Result 2020: आज जारी हो सकता है बीएसईबी बिहार बोर्ड मैट्रिक रिजल्ट बिहार बोर्ड के मैट्रिक के परिणाम BSEB की आधिकारिक वेबसाइट्स http://www.bsebinteredu.in, www.biharboardonline.bihar.gov.in, http://bsebbihar.com  पर भी चेक कर सकेंगे। Bihar 10th Result 2020 Soon: Latest update indicates that BSEB Matric … Read more