What do you want to save?
Add Code snippet
New code examples
-
C 2022-01-26 12:21:39
divide a linked list into three parts based on their position mod 3.
int split_list(struct node *ll) { struct node *l1, *l2, *l3; if(!(ll && ll->next && ll->next->next)){ printf("Need atleast 3 elements\n"); return -1; } l1 = ll; l2 = ll->next; l... Add solution -
Other 2022-01-26 11:50:34
#include <stdio.h> int main (void) { int a, b; printf("Dwse mou dio akeraious arithmous: \n"); scanf("%d %d", &a, &b); printf("Oi arithmoi poy edwses einai: %d kai %d", a, b); return 0; }
#include <stdio.h> int main (void) { int a, b; printf("Dwse mou dio akeraious arithmous: \n"); scanf("%d %d", &a, &b); printf("Oi arithmoi poy edwses einai: %d kai %d", a, b); return 0; } Add solution -
Other 2022-01-26 11:11:01
Programs to print triangles using *, numbers, and characters
#include <stdio.h> int main() { int i, space, rows, k = 0, count = 0, count1 = 0; printf("Enter the number of rows: "); scanf("%d", &rows); for (i = 1; i <= rows; ++i) { for (space = 1; space <= rows -... Add solution -
Other 2022-01-25 20:05:51
how to count the most common letter in a string c
#include <stdio.h> #include <stdlib.h> #include <string.h> #define ENG_LETTERS 26 #define STR_LEN 100 int main() { int countArray[ENG_LETTERS] = {0}; char str[STR_LEN] = { 0 }; char engChar = 'a' - 1; int length = 0; ... Add solution -
C 2022-01-25 17:26:31
C Program to evaluate postfix expression using stack
#include<stdio.h> int stack[20]; int top = -1; void push(int x) { stack[++top] = x; } int pop() { return stack[top--]; } int main() { char exp[20]; char *e; int n1,n2,n3,num; printf("Enter the expression :: "); ... Add solution -
Other 2022-01-24 00:10:16
dining philosophers problem solution using semaphores in c
/* This code is contributed by : Tanishq Vyas (github : https://github.com/tanishqvyas ) Use of Binary Semaphores has been made along with inversion of last philosopher's order of picking chopsticks, in order to avoid circular wait condition. Thus preven... Add solution -
TypeScript 2022-01-23 17:06:28
between two sets problem hackerrank solution in c
#include<stdio.h> int main() { int n,t,flag1,flag2,j,total=0,i; int m; scanf("%i %i", &n, &m); int a[n],b[m]; for (i = 0; i < n; i++) scanf("%i",&a[i]); for (i = 0; i < m; i+... Add solution