Skip to content

Instantly share code, notes, and snippets.

View sashuu69's full-sized avatar
🇮🇳
At Bangalore

Sashwat K sashuu69

🇮🇳
At Bangalore
View GitHub Profile
@sashuu69
sashuu69 / magicmat.c
Created January 31, 2018 05:10
Magic Square game for 2 players
#include<stdio.h>
struct game
{
int arr[10][10];
int cnt;
int score;
}game[2];
void main()
{
int n,i,j,k,r,c,ele,ch,diag1=0,diag2=0,row=0,col=0,flag=0;
@sashuu69
sashuu69 / burgleralarm.ino
Created February 1, 2018 06:10
This is a code to make a burgler alarm using photodiode, ultrasonic sensor, PIR sensor and OLED display. The values might change based on the gap between the photodiode and the IR LED.
/*
* Program name: burgleralarm
* Author : Sashwat K
* Created on 2 NOV 2017
* Revision : 3
* Revision on : 29 NOV 2017 08:37 AM
* Device : Arduino UNO
* NOTE :-
* Photo Transistor : above 100 <- the transistor is sensing IR signal
* less than 100 <- the transistor is not sensing IR signal
@sashuu69
sashuu69 / bank.java
Created February 1, 2018 08:43
My simulation of Bank ATM using core JAVA. Input --> Account balance
import java.util.Scanner;
public class bank
{
public static void main(String args[])
{
int ch,ch1;
Scanner sc=new Scanner(System.in);
bank_account accou=new bank_account();
System.out.println("Enter balance: ");
accou.balance=sc.nextFloat();
@sashuu69
sashuu69 / poly.c
Created March 19, 2018 08:08
Multiplying two polynomials using linked list
#include<stdio.h>
#include<stdlib.h>
struct node
{
int coefficient,exponent;
struct node *next;
};
struct node *hPtr1,*hPtr2,*hPtr3;
@sashuu69
sashuu69 / marksheet.c
Last active March 19, 2018 08:14
Marksheet implementation using c language.
/* Marksheet */
#include<stdio.h>
main()
{
char name[20];
int sem,i;
float dm[3],c[3],ps[3],pom[3],df[3],tot[5],tot1,totper;
printf("Enter the following data:-\n");
printf("Enter name: ");
@sashuu69
sashuu69 / storageclass.c
Created March 19, 2018 08:17
Different storage classes in C language.
/* Program */
/* a : To store value 5 (extern variable) */
/* b : To store value 10 (Golbal variable) */
/* c : To store value 32 (auto variable) */
/* d : To store character A (register variable) */
/* e : To store increment value (static variable) */
#include<stdio.h>
#include <time.h>
@sashuu69
sashuu69 / towerofhanoi.c
Created March 19, 2018 08:19
Tower of hanoi using C language.
#include<stdio.h>
void toh(int,char,char,char);
main()
{
int n;
printf("Tower of Hanoi:- \n");
printf("1. Enter number of disks: ");
scanf("%d",&n);
@sashuu69
sashuu69 / per.c
Created March 19, 2018 08:20
Print percentage value from 1 -100 of a number using recursion.
#include<stdio.h>
void recursion(int ,float);
main()
{
float num;
printf("Enter a value to split in percentage: ");
scanf("%f",&num);
recursion(1,num);
}
@sashuu69
sashuu69 / railway.c
Created March 19, 2018 08:23
Railway reservation system using files in C.
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
float func_calculate(char[],char[]);
float func_calc_tariff(float);
struct travel_distance
{
@sashuu69
sashuu69 / sparse.c
Created March 19, 2018 08:27
Implementing sparse matrix using C language.
#include<stdio.h>
struct sparse
{
int mat[10][10];
int size;
}sp;
void sp_int(int,int);
void loca(int,int);