Skip to content

Instantly share code, notes, and snippets.

View krishnaprajapat's full-sized avatar

Krishna Kumar Prajapat krishnaprajapat

View GitHub Profile
@krishnaprajapat
krishnaprajapat / linear.c
Created July 20, 2018 13:07
Linear search of a number from array in c
#include <stdio.h>
//Compiler version gcc 6.3.0
int main()
{
int a[5],n,i,f=0;
printf("\nenter array element");
for(i=0;i<5;i++)
scanf("%d",&a[i]);
printf("\nenter element u want to search from array");
@krishnaprajapat
krishnaprajapat / krishna.cpp
Created July 19, 2018 16:21
Tower of Hanoi using c++
#include<iostream>
using namespace std;
void tower(int n,char src,char aux,char targ)
{
if(n==1){
cout<<"transfer disk"<<n<<src<<"to"<<targ;}
else
{