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<unistd.h> | |
#define MAX 49 | |
char alpha[MAX] ="ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.,:?'-/()\"@="; | |
char *morse[MAX]={ ".-","-...","-.-.","-..",".","..-.","--.", | |
"....","..",".---","-.-",".-..","--","-.", | |
"---",".--.","--.-",".-.","...","-","..-", | |
"...-",".--","-..-","-.--","--..", |
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> | |
int main(){ | |
int i,n,c=1,sum=0; | |
printf("\n Last number of series : "); | |
scanf("%d",&n); | |
if(n>0 && n%2){ | |
printf("\n Series = "); | |
for(i=1; i<(n/2)+2; i++){ | |
if(i==1)printf("1"); | |
else printf(i%2?"+%d":"-%d",c); |
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> | |
int main(){ | |
int i,n,c=1,sum=0; | |
scanf("%d",&n); | |
for(i=1; i<(n/2)+2; i++,c+=2) | |
i%2 ? sum += c : (sum -= c); | |
printf("Sum = %d",sum); | |
return 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> | |
#define MAX 3 | |
int *return_array(int x[], int y[],int count){ | |
int i; | |
int *z = (int*)malloc(count); | |
for(i=0; i<count; i++) | |
z[i] = x[i] * y[i]; | |
return z; |
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
########## | |
# Win10 Initial Setup Script | |
# Author: Disassembler <disassembler@dasm.cz> | |
# Version: 1.7, 2016-08-15 | |
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ | |
# THIS IS A PERSONALIZED VERSION | |
# This script leaves more MS defaults on, including MS security features. | |
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1 |
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
/** Simple Pacman Like Game **/ | |
#include<stdio.h> | |
#include<conio.h> | |
//#include<stdlib.h> //if compiler asks | |
#define ROW 20 | |
#define COL 80 //keep it min 50,max 80 for best look | |
#define MAX_GHOST 20 | |
#define DOTS_FOR_POINT 10 |
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
/** | |
* Create a class named 'rotation'. it contains 4 variables of int type. | |
* Write a function to rotate their values with pass by ref. approach. | |
*/ | |
#include<iostream> | |
#include<conio.h> | |
using namespace std; | |
class rotation{ | |
private: |
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
/* | |
* Create 3 classes which takes the data for 3 semesters containing info of subject and marks | |
* Calculate the % for all semester | |
* finally calculate CGPA with a function program | |
*/ | |
#include<iostream> | |
#include<conio.h> | |
using namespace std; |
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<fstream> | |
#include<conio.h> | |
using namespace std; | |
int main(){ | |
fstream f1, f2; | |
char name[20], c1, c2; | |
int flag=3; |
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 <windows.h> | |
TCHAR getch(){ | |
DWORD mode, cc; | |
HANDLE h = GetStdHandle( STD_INPUT_HANDLE ); | |
if (h == NULL) | |
return 0; // console not found | |
GetConsoleMode( h, &mode ); | |
SetConsoleMode( h, mode & ~(ENABLE_LINE_INPUT | ENABLE_ECHO_INPUT) ); | |
TCHAR c = 0; | |
ReadConsole( h, &c, 1, &cc, NULL ); |
OlderNewer