Skip to content

Instantly share code, notes, and snippets.

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

Pratik Sah ThePratikSah

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Resume</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<title>Pi Remote Control</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU"
crossorigin="anonymous">
</head>
@ThePratikSah
ThePratikSah / matchstickGame.c
Created November 11, 2018 08:39
Here is the code for MatchStick game. Hope you'll enjoy playing.
#include <stdio.h>
int main(){
int match = 21, comp, user, choice, c = 0;
printf(“Game Rules:\nYou have to pick 1, 2, 3 or 4 matchstick at a time.”);
printf(“\nAfter your picking, computer does its picking.”);
printf(“\nWhoever is forced to pick the last matchstick looses the game.”);
printf(“\nPress 1 to start the game:”);
scanf(“%d”, &choice);
while (choice == 1) {
do {
@ThePratikSah
ThePratikSah / digitCounter.c
Created November 11, 2018 08:29
Digits counter from a number
#include<stdio.h>
int main(){
int num, count = 0;
printf("Enter any number:");
scanf("%d", &num);
if(num == 0)
count = 1;
else{
while(num != 0){
num = num / 10;
#include <stdio.h>
#include <string.h>
int main(){
char str[40];
int i, word = 1;
printf("Enter a sentence:\n");
scanf("%[^\n]s", str);
for( i = 0 ; str[i] != '\0' ; ++i){
if(str[i] == ' ')
word++;
#include <stdio.h>
#include <string.h>
int main(){
char str[10] = "Hello";
int i, length = strlen(str);
printf("Reverse of string Hello is ");
for(i = length - 1 ; i >= 0 ; i--){
printf("%c", str[i]);
}
}
#include <stdio.h>
int main(){
char name[20];
printf("Enter your full name: ");
scanf("%[^\n]s", name);
printf("Your name is %s.", name);
}
#include <stdio.h>
#include <string.h>
int main(){
char name[25];
printf("Enter your full name: ");
gets(name);
puts(name);
}
#include <stdio.h>
int main(){
char str[20];
scanf("%s", str);
printf("%s", str);
}
#include <stdio.h>
int main(){
char str[] = "HELLO";
printf("%s", str);
}