What do you want to save?
Add Code snippet
New code examples
-
C 2021-09-17 14:15:01
c program to find the sum of given number using recursion
# include <stdio.h> int sum(int number); int main { int n; int a; printf("enter a number"); scanf("%d,&n); a=sum(n); printf("sum=%d",a); } int sum(int number) { if (number==0) return 0; return(number%10+su... Add solution -
-
TypeScript 2021-09-17 12:54:02
Write a C program to count total number of duplicate elements in an array.
/** * C program to count total number of duplicate elements in an array */ #include <stdio.h> #define MAX_SIZE 100 // Maximum array size int main() { int arr[MAX_SIZE]; int i, j, size, count = 0; /* Input size of array */ prin... Add solution -
C 2021-09-17 02:41:03
How to pass a struct value to a pthread in c?
struct my_Struct{ int val1, val2; }; void* my_Func(void *received_struct){ //Creating a pointer to point to the received struct struct my_Struct *struct_ptr = (struct my_Struct*) received_struct; printf("Value 1: %d | Value 2: % \n", st... Add solution -
C++ 2021-09-17 02:31:04
test when c++ destructor is called
// order_of_destruction.cpp #include <cstdio> struct A1 { virtual ~A1() { printf("A1 dtor\n"); } }; struct A2 : A1 { virtual ~A2() { printf("A2 dtor\n"); } }; struct A3 : A2 { virtual ~A3() { printf("A3 dtor\n"); ... Add solution