This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<string.h> | |
#include<stdio.h> | |
int main() | |
{ | |
char s[100000]; | |
int n,count=0,i,T,o=0,c=0; | |
scanf("%d",&T); | |
while(T--) | |
{ | |
c = 0, o = 0, count=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void display_binary_n(int dec) | |
{ | |
const int size = sizeof(int) * 8 ; | |
unsigned int current; | |
int i; | |
for( i = size - 1 ; i >= 0 ; i--) | |
{ | |
current = 1<<i; | |
printf("%d",( (current & dec) != 0) ? 1: 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <errno.h> | |
char* program_name; | |
void system_error(char* cause, int exit_code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
bool isLeapYear( unsigned int& ); //checks if 'year' is leap year | |
unsigned int firstDayOfJanuary( unsigned int& year ); | |
unsigned int numOfDaysInMonth( unsigned int , unsigned int& ); // takes the number of the month, and 'year' as arguments | |
void printHeader( unsigned int ); //takes the number of the month, and the first day, prints, and updates | |
void printMonth( unsigned int , unsigned int& ); //takes number of days in month, and reference to 'firstDayInCurrentMonth' so it updates after every call | |
void skip( unsigned int ); //prints the specified amount of spaces | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
#include<stdlib.h> | |
#include <windows.h> | |
int board[10] = {2,2,2,2,2,2,2,2,2,2}; | |
int turn = 1,flag = 0; | |
int player,comp; | |
void menu(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A palindrome is a word, phrase, number, or other sequence of symbols or elements, | |
whose meaning may be interpreted the same way in either forward or reverse direction. | |
This program will prompt the user to enter a word or a sentence and then confirms if | |
the user's entry is an palindrome or not. | |
*/ | |
#include <iostream> | |
#include <cstdlib> | |
bool isPalindrome( char [] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
#include <time.h> | |
#include <conio.c> | |
main() | |
{ | |
int random(int x) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************************* | |
Console-based version of Minesweeper 2.0.1 | |
Copyright (C) <2012> <jAs MLt. Ltd.> | |
Email: junayedsunny8@gmail.com | |
To-do list: | |
1. Create a function where user can select levels {easy, medium, hard} | |
OTHER NOTES: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************************* | |
Console-based version of Minesweeper 1.01 | |
Copyright (C) <2012> <jAs MLt. Ltd.> | |
Email: junayedsunny8@gmail.com | |
To-do list: | |
1. Create a function where user can select levels {easy, medium, hard} |