S

@Shobh89

C program to create copy of a singly Linked List using Recursion

C
1 year ago
//C program for the above approach #include <stdio.h> #include<stdlib.h> //Node for linked list struct Node { int data; struct Node*next; };

Convert Binary to Decimal in C

C
1 year ago
// C program to convert binary to decimal #include <stdio.h> // Function to convert binary to decimal int binaryTodecimal(int n) { int num=n; int dec_value=0; //Initializing base value to 1, i.e 2^0

C Program to Find the Sum of Fibonacci Numbers at Even Indexes up to N Terms

C
1 year ago
//C program to find sum of //even-indices of fibonacci numbers #include <stdio.h> //Computes value of the first //fibonacci numbers and stores //the even-indices sum int calculateEvenSum(int n) { //return 0 if n is equals or less than 0

C Program To Find Area And Perimeter of Rectangle

C
1 year ago
//C program to demonstrate the //area and perimeter of rectangle #include <stdio.h> int main() { int l=90,b=678; printf("Area of rectangle is :%d",l*b); printf("\nPerimeter of rectangle is:%d",2*(l+b));

C Program to Split a String into a Number of Sub-Strings

C
1 year ago
// C program for splitting a string // using strtok() #include <stdio.h> #include <string.h> int main() { char str[] = "Geeks-for-Geeks"; // Returns first token

C Program to Find Determinant of a Matrix

C
1 year ago
//C program to find Determinant //of a matrix #include <stdio.h> //Dimension of input square matrix #define N 4 //Function to get cofactor of mat[p][q] //in temp[][].n is current dimension //of mat[][]

C Program To Find Normal and Trace of Matrix

C
1 year ago
//C program to find trace //and normal of given matrix #include <stdio.h> #include<math.h> //Return Normal of a matrix //of size n * n int findNormal(int mat[][3], int n) {

C Program to Add Two Rectangular Matrices

C
1 year ago
//C program to implement //the above approach #include<stdio.h> #define M 4 #define N 3 //This function adds A[][] and B[][], //and stores the result in C[][] void add(int A[M][N],int B[M][N],int C[M][N]) {

C Program to Add Two Square Matrices

C
1 year ago
// C program to implement // the above approach #include <stdio.h> #define N 4 // This function adds A[][] and B[][], // and stores the result in C[][] void add(int A[][N], int B[][N], int C[][N]) { int i, j;

Matrix Multiplication in C

C
1 year ago
//C program to multiply two matrices #include <stdio.h> #include<stdlib.h> //matrix dimensions so that we dont have to pass them as //parametersmat1[R1][C1] and mat2[R2][C2] #define R1 2 #define C1 2 #define R2 2 #define C2 3

C Program to Print Boundary Elements of a Matrix

C
1 year ago
//C program to demonstrate the boundary //element of matrix #include <stdio.h> //This function display the Boundary of a matrix void printBoundary(int mat[][4],int m,int n) { printf("\n Boundary of Matrix\n"); for(int i=0;i<m;i++){ for(int j=0;j<n;j++){

C Program to Compute the Sum of Diagonals of a Matrix

C
1 year ago
//C program to demonstrate the //Sum of diagonals of a matrix. #include <stdio.h> int main() { int i,j,m=3,n=3,a=0,sum=0; //input matrix

C Program to Interchange Elements of First and Last in a Matrix Across Rows

C
1 year ago
//C program to interchange the elements //of first and last row in a matrix //across rows #include <stdio.h> #define n 3 //Function to swap the element //of first and last row void interchangeFirstLast(int m[][n])

C Program to Interchange Elements of First and Last in a Matrix Across Columns

C
1 year ago
//C program to swap the element of first and last column of //the matrix and display the result #include <stdio.h> #define n 3 //*macros void interchangeFirstLast(int mat[][n]) { //swap the elements between first and last columns for(int i=0;i<n;i++){

C program to print Diamond Pyramid of ” * ” & Numbers

C
1 year ago
#include <stdio.h> int main() { int n=5; //Print the top pyramid for(int i=1;i<=n;i++){ for(int j=1;j<=n-i;j++){ printf(" "); }

C Program to Print hollow pyramid of ” * ” & Numbers

C
1 year ago
#include <stdio.h> int main() { int n=5; for(int i=1;i<=n;i++){ //Print the leading spaces for(int j=i;j<n;j++){ printf(" "); }

C Program to Print Full Pyramid of Numbers in 180 Degree

C
1 year ago
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }

C Program to Print Full Pyramid Pattern of Numbers

C
1 year ago
//C program to print the full pyramid pattern of alphabets #include <stdio.h> int main() { int rows; printf("Number of rows: "); scanf("%d",&rows); //first loop to print all rows

C Program to Print Inverted Half Pyramid Pattern of Numbers

C
1 year ago
//C program to print inverted half pyramid pattern of number #include <stdio.h> int main() { int rows; printf("Number of rows"); scanf("%d",&rows); //first loop for printing rows

C Program to Print Half Pyramid Pattern of Numbers

C
1 year ago
//C program to print right half pyramid pattern of star #include <stdio.h> int main() { int rows; printf("Number of rows"); scanf("%d",&rows); //first loop for printing rows