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
/* | |
* | |
* Title: Finding the Armstrong Number | |
* By: Suryansh Singh Shishodia | |
* Github: https://github.com/elekktron | |
* | |
*/ | |
#include <stdio.h> | |
#include <math.h> |
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
/* | |
* 1 2 3 4 5 6 7 8 9 <------ x (i) | |
* 1 * * * * * * * * * | |
* 2 * * * * * * * * | |
* 3 * * * * * * | |
* 4 * * * * | |
* 5 * * | |
* ^ | |
* | | |
* | |
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
#!/bin/sh | |
# if compiled from sources | |
# place this file inside /usr/local/etc/rc.d | |
# point _pidfrefix where nginx holds pid file | |
. /etc/rc.subr | |
name="nginx" | |
rcvar=nginx_enable |
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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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 num, i; | |
scanf("%d", &num); | |
int array[num]; | |
for (i = 0; i < num; i++) { | |
scanf("%d", &array[i]); | |
} |
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 x1, x2, v1, v2, i = 0, flag = 0; | |
scanf("%d%d%d%d", &x1, &v1, &x2, &v2); | |
for (i = 0; i < 10000; i++) { | |
if ((x1 + i*v1) == (x2 + i*v2)) { | |
flag = 1; | |
break; |
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 m, n, i, out; | |
scanf("%d", &m); | |
int arr[m]; | |
for(i = 0; i < m; i++) | |
scanf("%d", &arr[i]); | |
scanf("%d", &n); |
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, count = 0, low, high, mid, n, key, array[100]; | |
scanf("%d",&n); | |
for(i = 0; i < n; i++) | |
scanf("%d",&array[i]); | |
scanf("%d", &key); | |
low = 0; | |
high = n - 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
/* Selection Sort Algorithm */ | |
#include <stdio.h> | |
int main() { | |
int i, j; | |
int min, temp; | |
int c = 0, s = 0; | |
int n; |
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 partition(int s[], int l, int h) { | |
int i, p, firsthigh, temp; | |
p = h; | |
firsthigh = l; | |
for (i = l; i < h; i++) { | |
if (s[i] < s[p]) { | |
temp = s[i]; |
OlderNewer