What do you want to save?
Add Code snippet
New code examples
-
C 2022-02-16 02:40:16
passing a pointer to a function
// passing a pointer to function in C // It increaments the salary of an employee #include <stdio.h> void salaryhike(int *var, int b) { *var = *var+b; } int main() { int salary=0, bonus=0; printf("Enter the employee current salar... Add solution -
C++ 2022-02-16 02:30:33
void *malloc( size_t size ) { //do your stuf here return ::malloc(size); }
/* malloc example: random string generator*/ #include <stdio.h> /* printf, scanf, NULL */ #include <stdlib.h> /* malloc, free, rand */ int main () { int i,n; char * buffer; printf ("How long do you want the string? "... Add solution -
C 2022-02-14 22:50:07
sum of all column in matrix in c
/* C Program to find Sum of columns in a Matrix */ #include<stdio.h> int main() { int i, j, rows, columns, a[10][10], Sum; printf("Please Enter Number of rows and columns : "); scanf("%d %d", &i, &j... Add solution -
C++ 2022-02-13 23:15:04
code implementation of krushkals algorithm
a,b,u,v,n,ne=1; int min,mincost=0,cost[9][9],parent[9]; int find(int); int uni(int,int); void main() { #include ... Add solution -
C 2022-02-13 21:20:06
floyd warshall algorithm c program
#include<stdio.h>#include<conio.h>int min(int,int);void floyds(int p[10][10],int n) { int i,j,k; for (k=1;k<=n;k++) for (i=1;i<=n;i++) for (j=1;j<=n;j++) if(i==j) p[i][j]=0; else p[i][j]=min(p[i][j],p[i][k]+p[k][j])... Add solution -
Other 2022-02-09 23:50:18
how to swap using bitwise operator
#include<stdio.h> void main() { int a,b; printf("Enter the value of a and b: "); scanf("%d %d", &a, &b); a = a^b; b = b^a; a = a^b; printf("Value of a is: %d\n", a); printf("... Add solution -
C 2022-02-09 10:55:11
c exponential until value
#include <stdio.h> #include <stdlib.h> int main() { int a, b, c; printf("Enter number: "); scanf("%d", &a); printf("\nEnter limit: "); scanf("%d", &b); c = a; while(a < (b + 1)... Add solution -
Other 2022-02-07 04:30:16
dijkstra algorithm using c
#include<stdio.h>#include<conio.h>#define INFINITY 9999#define MAX 10 void dijikstra(int G[MAX][MAX], int n, int startnode); void main(){ int G[MAX][MAX], i, j, n, u; clrscr(); printf("\nEnter the no. of vertices:: "); scan... Add solution