Initial commit

This commit is contained in:
2023-05-22 23:28:51 -03:00
commit 5c1403aa91
467 changed files with 18649 additions and 0 deletions

5
Labs/Lab1/C/HelloWorld.c Normal file
View File

@ -0,0 +1,5 @@
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}

BIN
Labs/Lab1/C/HelloWorld.exe Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

BIN
Labs/Lab1/Lab1.pdf Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}

View File

@ -0,0 +1,33 @@
#include <stdio.h>
int main(){
int value;
int iErr;
printf("Value to examine: ");
iErr = scanf("%d",&value);
if(iErr != 1){
printf("Unable to read the value\n");
return 0;
}
if(value <= 0) {
printf("Value must be positive\n");
return 0;
}
int binaryArray[32];
int arrayLength = 0;
while(value > 0) {
binaryArray[arrayLength] = value % 2;
value = value/2;
arrayLength++;
}
int counter = 0;
for(int i = arrayLength; i >= 0; i--) {
if (binaryArray[i] == 1) {
counter++;
}
}
printf("Number of ones: %d\n", counter);
return 0;
}

View File

@ -0,0 +1,5 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Binary file not shown.

33
Labs/Lab1/countOnes.c Normal file
View File

@ -0,0 +1,33 @@
#include <stdio.h>
int main(){
int value;
int iErr;
printf("Value to examine: ");
iErr = scanf("%d",&value);
if(iErr != 1){
printf("Unable to read the value\n");
return 0;
}
if(value <= 0) {
printf("Value must be positive\n");
return 0;
}
int binaryArray[32];
int arrayLength = 0;
while(value > 0) {
binaryArray[arrayLength] = value % 2;
value = value/2;
arrayLength++;
}
int counter = 0;
for(int i = arrayLength; i > 0; i--) {
if (binaryArray[i] == 1) {
counter++;
}
}
printf("Number of ones: %d", counter);
return 0;
}

BIN
Labs/Lab1/countOnes.exe Normal file

Binary file not shown.