Compare commits

..

2 Commits

Author SHA1 Message Date
3cbf19ee6a copied second template 2025-02-10 10:46:56 +01:00
39d39169fb Copied template code 2025-02-10 10:43:42 +01:00
3 changed files with 52 additions and 0 deletions

BIN
a.out Executable file

Binary file not shown.

35
main.c
View File

@ -0,0 +1,35 @@
#include <stdio.h> // Be és kimenetekhez határoz meg változókat,makrókat és funckiókat.
#include <stdlib.h> // Általános függvény végrehajtásokhoz.
//argc = hány db karakter
//argv = argumentumok listája
int main(int argc, char **argv)
//char** means an array of character arrays = array of strings
{
int num1 = 6;
int num2 = 5;
char char1 = 'A';
printf("Values of this two var are: %i and %i\n", num1, num2);
printf("Char is: %c\n", char1);
printf("Char is: %i\n", char1); //ascii
int result = 0;
result = num1 + num2;
printf("Result: %i\n", result);
return 0;
}
/*
%d takes integer value as signed decimal integer i.e. it takes negative values along with positive values
but values should be in decimal otherwise it will print garbage value.
%i takes integer value as integer value with decimal, hexadecimal or octal type.
*/
/*
signed by default, meaning it can represent both positive and negative values.
unsigned is an integer that can never be negative.
*/

17
sec.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h> // Be és kimenetekhez határoz meg változókat,makrókat és funckiókat.
#include <stdlib.h> // Általános függvény végrehajtásokhoz.
//call it with some parameters from the command line
//argc = hány db karakter
//argv = argumentumok listája
int main(int argc, char **argv)
//char** means an array of character arrays = array of strings
{
int i;
printf("Number of command line arguments are: %i\n", argc);
for (i = 0; i < argc; i++)
{
printf("%i. argument is %s\n", i, argv[i]);
}
return 0;
}