0% found this document useful (0 votes)
6 views

AGH Computer Science C Programming Laboratory 1

Uploaded by

michalgach.0ff
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

AGH Computer Science C Programming Laboratory 1

Uploaded by

michalgach.0ff
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Laboratory 01 – Hello World 02.10.

2024

1. [no points] Source code. Compiler. Running the program.


A. Log in to [email protected] account.
B. Change the password using the passwd command.
C. Create the hello.c file in any text editor and put the content of the following program into it:
#include <stdio.h>
int main (void) {
printf("Hello World.\n");
return 0;
}
D. Go to the directory where the saved file is located and start the compilation process.
gcc hello.c

E. Run the program using the command:


./a.out

F. Compile the program again, this time using the following command:
gcc hello.c -o hello

G. Run the program with the command:


./hello

H. Discussion of program structure. Identification of the syntactic meaning of keywords.

2. [no points] Simple programs.


A. Write a program that prints out your name.
B. Write a program that, using the printf function and the sizeof operator, prints out the sizes of
basic data types in bits and bytes. Do not use variables.
C. Write a program that prints out your name in ASCII code.
D. Write a program that converts your age in years to age in days, hours, minutes, seconds. Do not
include fractions of years or leap years.
3. Submit the source codes of all the exercises you have written to UPEL.

Next lab – Variables and operators.

You might also like