Skip to content

Instantly share code, notes, and snippets.

View lazyakshay's full-sized avatar
🎯
Focusing

Akshay Kumar lazyakshay

🎯
Focusing
View GitHub Profile
@lazyakshay
lazyakshay / ticactoe.c
Created October 31, 2017 10:12
Tic Tac Toe Program in c language
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//player 0=max;
//player 1=min;
//your symbol=X;
//comp symbol=O;
struct pair{
int move;
#include<stdio.h>
int main()
{
int n,w,h,i,t;
scanf("%d",&t);
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d %d",&w,&h);
if(w>=t&&h>=t)
#include <iostream>
using namespace std;
int main()
{
// cout << "Hello World!" << endl;
long long n,sum=1;
cin>>n;
for(int i=1;i<=n;i++) sum *= i;
cout<<sum;
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
#include <iostream>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
while(n!=42)
{
printf("%d\n",n);
#include <bits/stdc++.h>
using namespace std;
int main()
{
int prime[] = {67,71,73,79,83,89,97,101,103,107,109,113};
int t;
cin>>t;
while(t--){
int n;
#include<bits/stdc++.h>
using namespace std;
int main()
{
//cout << "Hello World!" << endl;
//vector<int> prime;
int n;
cin>>n;
int p=2;
@lazyakshay
lazyakshay / fibonacci.sh
Created April 8, 2017 13:30
shell script to generate fibonacci series
#!/bin/bash
c=2
a=1
b=1
d=0
echo "enter the number of elements"
read n
echo "$a"
echo "$b"
while((c<n))
@lazyakshay
lazyakshay / factorial.sh
Created April 8, 2017 13:18
shell script to find factorial
#!/bin/bash
factorial()
{
ans=$1
if((ans<=2)); then
echo $ans
else
f=$((ans-1))
f=$(factorial $f)
f=$((f*ans))
@lazyakshay
lazyakshay / printodd.sh
Created April 8, 2017 13:10
print the digit that are at odd position
#!/bin/bash
echo "enter 5 digit number"
read number
n=1
while((n<=5))
do
a=`echo $number | cut -c $n`
echo -n "$a"
n=`expr $n + 2`
done