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

C Program example to Find Quotient and Remainder

c prgram avoid goto

C Program example to Find Quotient and Remainder #include<stdio.h> int main() { printf(“\n\n\t\tEduguru – C prgram example\n\n\n”); int c, d, n, a[100], b[100]; printf(“\n\nEnter number of elements in array :”); scanf(“%d”, &n); printf(“\n\nEnter %d elements\n”, n); for(c = 0; c < n; c++) scanf(“%d”, &a[c]); /* temporarily storing elements into array b starting from end … Read more

C Program to find the Sum of First n Natural numbers using for loop

C Program to find the Sum of First n Natural numbers

C Program to find the Sum of First n Natural numbers using for loop   #include <stdio.h> int main() { int n, count, sum = 0; printf(“Enter the value of n(positive integer): “); scanf(“%d”,&n); for(count=1; count <= n; count++) { sum = sum + count; } printf(“Sum of first %d natural numbers is: %d”,n, sum); … Read more

C Program to print the Multiplication Table of any Number

multiplication table program in c

C Program to print the Multiplication Table of any Number #include<stdio.h> int main() { printf(“\n\n\t\tEduguru – C Program Example\n\n\n”); int n,i; printf(“Enter an integer you need to print the table of: “); scanf(“%d”, &n); printf(“\n\n\n”); for(i = 1; i <= 10; i++) { printf(“\n\t\t\t%d * %d = %d \n”, n, i, n*i); } printf(“\n\n\n\n\t\t\tAll Done … Read more

Program to check if input Number is int or float

pointer program example in c

Program to check if input Number is int or float #include<stdio.h> #include<conio.h> #include<string.h> int main() { printf(“\n\n\t\tEduguru – C Program example\n\n\n”); char number[10]; int flag = 0; int length, i = 0; printf(“\n\nEnter a number: “); scanf(“%s”, number); length = strlen(number); // till string does not end while(number[i++] != ‘\0’) // same as while(length–>0) { … Read more

C Program to calculate Power of N using Recursion

c program to add 2 numbers

C Program to calculate Power of N using Recursion   #include<stdio.h> // function prototype declaration int power(int n1, int n2); int main() { printf(“\n\n\t\tStudytonight – Best place to learn\n\n\n”); int base, exp; printf(“Enter base number: “); scanf(“%d”, &base); printf(“\n\nEnter Power factor: “); scanf(“%d”, &exp); printf(“\n\n\n\t\t\t%d^%d = %d”, base, exp, power(base, exp)); printf(“\n\n\t\t\tCoding is Fun !\n\n\n”); … Read more

Program to find Palindrome using Recursion

palindrome program in c

Program to find Palindrome using Recursion A Palindrome is a sequence that if reversed looks identical to the original sequence Eg : abba, level, 999 etc. #include<stdio.h> // declaring the recursive function int isPal(int ); /* global declaration to use the same value in both the functions */ int n; int main() { printf(“\n\n\t\tStudytonight – … Read more

The Basics of the Computer Virus

A plethora of negative magazine articles and books have catalyzed a new kind of hypochondria among computer users: an unreasonable fear of computer viruses. This hypochondria is possible because a) computers are very complex machines which will often behave in ways which are not obvious to the average user, and b) computer viruses are still … Read more

Google Search Advanced Operators

Beyond the basic searching techniques explored in the previous articles, Google offers special terms known as advanced operators to help you perform more advanced queries.These operators, used properly, can help you get to exactly the information you’re looking for without spending too much time poring over page after page of search results. When advanced operators … Read more