This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This Program is for creating child process. It works only in Linux operating System. | |
//To run this code in linux environment you need to follow the below steps: | |
1. write cc and then put the '.c' "file location/address here" then press enter. | |
2. write ./a.out to generate the output of the code. | |
*/ | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Delete an elements from an array /// | |
#include <stdio.h> | |
main() | |
{ | |
int a[5]={1,2,3,4,5},n=5,pos,item,i,j; | |
printf("Enter an position to delete an element:"); | |
scanf("%d",&pos); | |
printf("Before deleting element :\n"); | |
for(i=0;i<n;i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// insert new elements into an array /// | |
#include <stdio.h> | |
main() | |
{ | |
int a[100],n,pos,item,i; | |
printf("Enter how many elements :"); | |
scanf("%d",&n); | |
printf("Enter %d elements values :",n); | |
for(i=0;i<n;i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<math.h> | |
int main() | |
{ | |
int first,second,value,count,i; | |
while(scanf("%d %d",&first,&second)) | |
{ | |
if(first==0 && second==0) | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 10101 Bangla Numbers /// | |
#include<stdio.h> | |
void bangla(long long int ); | |
int main() | |
{ | |
long long int n; | |
int c=1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Breadth First Search Implementation in C /// | |
#include<stdlib.h> // this header file is needed for exit function | |
#include<stdio.h> | |
#define max 20 | |
int queue[max]; | |
int front,rear; | |
int BFS(int arr[][max],int ,int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Depth First Search Implementation in C++ /// | |
#include<iostream> | |
#include<stdio.h> | |
#define max 20 | |
int stack[max]; | |
int top; | |
void DFS(int arr[][max],int,int); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Breadth First Search for weighted undirected graph ! | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define max 20 | |
int queue[max]; | |
int front,rear; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// longest Increasing Subsequence /// | |
#include<stdio.h> | |
#define max 100 | |
main() | |
{ | |
int arr[max],len[max],i,j,n,LIS; | |
printf("Enter the no of Elements :"); | |
scanf("%d",&n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The 3n+1 problem // | |
#include<stdio.h> | |
long long count(long long n){ | |
long long c; | |
c=1; | |
while(n>1){ | |
if(n%2!=0){ | |
n=(3*n)+1; |