Skip to content

Instantly share code, notes, and snippets.

View 78526Nasir's full-sized avatar
🎯
Focusing

Nasir Islam Sujan 78526Nasir

🎯
Focusing
View GitHub Profile
@78526Nasir
78526Nasir / ChildProcess.c
Created December 2, 2016 16:45
Creating Child Process using Fork!
/* 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>
@78526Nasir
78526Nasir / DeleteElementIntoArray.c
Last active June 2, 2016 18:36
Delete an element from an array !
/// 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++)
@78526Nasir
78526Nasir / InsertElementIntoArray.c
Last active June 2, 2016 18:27
These program is for inserting a new elements into an array !
/// 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++)
@78526Nasir
78526Nasir / SquareNumbers.c
Created April 26, 2016 14:29
11461 - Square Numbers !
#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;
@78526Nasir
78526Nasir / BanglaNumbers.c
Created April 23, 2016 04:23
10101 Bangla Numbers !
/// 10101 Bangla Numbers ///
#include<stdio.h>
void bangla(long long int );
int main()
{
long long int n;
int c=1;
@78526Nasir
78526Nasir / BreadthFirstSearch.c
Last active April 22, 2016 13:49
Breadth First Search Implementation in C !
/// 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);
@78526Nasir
78526Nasir / DepthFirstSearch.c++
Last active April 22, 2016 13:49
Depth First Search Implementation in C++ !
/// 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);
@78526Nasir
78526Nasir / BreadthFirstSearch(WUG).c
Last active April 22, 2016 13:48
Breadth First Search for weighted undirected graph !
/// Breadth First Search for weighted undirected graph !
#include <stdio.h>
#include <stdlib.h>
#define max 20
int queue[max];
int front,rear;
@78526Nasir
78526Nasir / LongestIncreasingSubsequence.c
Created April 22, 2016 13:46
longest Increasing Sub sequence in C !
/// 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);
@78526Nasir
78526Nasir / 3n+1.c
Created March 10, 2016 11:24
Solution of the 3n+1 problem !
// 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;