Remove C files

This commit is contained in:
2020-06-22 11:21:52 +02:00
parent 7ca64a7a82
commit 2da8957aac
10 changed files with 0 additions and 270 deletions

View File

@@ -1,35 +0,0 @@
#include <stdio.h>
int fib(int a) {
if(a==0){
return 0;
}else if(a==1){
return 1;
} else {
return (fib(a-1) + fib(a-2));
}
}
int main()
{
int count = 0;
int result = 0;
while(1){
int x = fib(count);
if(x>4000000){
printf("%d", result);
break;
}
if(x%2==0){
result = result + x;
}
count = count+1;
}
}

Binary file not shown.

View File

@@ -1,120 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int isPrime(int n){
for(int i=2;i<sqrt(n);i++){
if(n%i==0){
return 0;
}
}
return 1;
}
/*Returns amount of primes between 0 and n*/
int amountPrimes(int n){
int x=0;
for (int i = 2; i < n; i++)
{
if (isPrime(i)){
x+=1;
}
}
return x;
}
/*Returns array with primes between 0 and n*/
int * primesIn(int n){
int x = amountPrimes(n);
int * primes;
primes = malloc(sizeof(int)*x);
x=0;
for (int i = 2; i < n; i++)
{
if (isPrime(i)){
primes[x]=i;
x+=1;
}
}
return primes;
}
/*Factorial of n*/
long fact(int n){
if (n==1){
return 1;
} else {
return n*fact(n-1);
}
}
/*Retrieves the amount of factors in a number*/
int factoramount(int n){
if (isPrime(n)){
return 1;
} else {
for
}
}
/*Returns array with factors of n*/
int * factorize(int n){
int x = amountPrimes(n);
int * primes;
primes = malloc(sizeof(int)*x);
if(isPrime(n)) {
} else {
for (size_t i = 2; i < n; i++)
{
if (i%j==0)
{
}
}
}
}
int main(){
int * primes = primesIn(100);
for (size_t i = 0; i < amountPrimes(100); i++){
printf("Prime: %d\n", *(primes+i));
}
int * factCounter[amountPrimes(100)]
for (size_t i = 1; i < 100; i++){
}
long x = fact(100);
//SUM OF DIGITS OF X
printf("%ld\n", x);
}

Binary file not shown.

View File

@@ -1,35 +0,0 @@
#include <stdio.h>
#include <math.h>
int isPrime(long n){
for(int i=2;i<sqrt(n);i++){
if(n%i==0){
return 0;
}
}
return 1;
}
int main()
{
long count=1;
int big=0;
long number=600851475143;
while(count<number){
if(isPrime(count)){
//printf("Prime: %ld \n", count);
if (number%count==0){
printf("New big: %ld \n", count);
big=count;
}
}
count+=1;
}
return 0;
}

Binary file not shown.

View File

@@ -1,39 +0,0 @@
#include <stdio.h>
#include <string.h>
int main(){
int biggest = 0;
for (int i = 100; i < 1000; i++)
{
for (int j = 100; j < 1000; j++)
{
int x=i*j;
int z=x;
int y=0;
while (x != 0)
{
y = y * 10;
y = y + x%10;
x = x/10;
}
//printf("%d - %d\n", y, z);
if (y==z & y>biggest){
biggest = z;
}
}
}
printf("%d\n", biggest);
return 0;
}

View File

@@ -1,13 +0,0 @@
#include <std.io>
int main{
long a=0
for(int i=0;i<=1000;i++){
a+=(i^i);
}
printf("%ld", a);
}

Binary file not shown.

View File

@@ -1,28 +0,0 @@
#include <stdio.h>
int main(){
int x=5;
while(1){
for (int i = 2; i <= 20; i++)
{
if (x%i!=0){
break;
}
if(i==20){
printf("%d\n", x);
return 0;
}
}
x+=1;
}
return 0;
}