Commit a09b6011 by videid

FINALE VERSION OF LAB7

parent a4f10e4c
Showing with 35 additions and 2 deletions
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <cmath>
#define ARRAY_SIZE 25 #define ARRAY_SIZE 25
int function(int input); int function(int input);
int main() { int main() {
...@@ -22,4 +23,37 @@ int test() { ...@@ -22,4 +23,37 @@ int test() {
char b = "message"; char b = "message";
printf("%d",19 ) printf("%d",19 )
return b; return b;
} }
\ No newline at end of file
int function(int input2) : ;
h = int 1
i = int 0
j = int 1
k = int 0
l = int 0
arr = array
int main2() {
while (h < input2); {
i = i + 1
h = h * 2}
for (k = i - 1; k = 0; k = k - 1); {
l = l + 1
if (input2 - pow(j, k) > 0)
{
input2 = input2 - pow(j, k)
arr[l] = 1
}
else if (input2 - pow(j, k) = 0) {
input2 = 0
arr[l] = 1
}
else {
arr[l] = 0
}
printf("%d",arr)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment