Skip to content

Files

0x01-variables_if_else_while

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Aug 15, 2023
Oct 13, 2024

0x01-variables_if_else_while

Description

This project focuses on variables, conditional statements, and loops in C. It covers how to declare and use variables, how to use if, else, and while statements, and how to write programs that use these constructs effectively.

Resources

Read or watch

Learning Objectives

General

  • What are the arithmetic operators and how to use them.
  • What are the logical operators (sometimes called boolean operators) and how to use them.
  • What the if, if ... else statements are and how to use them.
  • How to declare variables of types char, int, unsigned int.
  • How to print the values of variables of type char, int, unsigned int with printf.
  • How to use the while loop.
  • How to use variables with the while loop.
  • How to print variables using printf.
  • What is the ASCII character set.
  • What are the purpose of the gcc flags -m32 and -m64.

Tasks

Task File Description
0. Positive anything is better than negative nothing 0-positive_or_negative.c Writes a program that assigns a random number to the variable n each time it is executed and prints whether the number stored in the variable n is positive or negative.
1. The last digit 1-last_digit.c Writes a program that assigns a random number to the variable n each time it is executed and prints the last digit of the number stored in the variable n.
2. I sometimes suffer from insomnia. And when I can't fall asleep, I play what I call the alphabet game 2-print_alphabet.c Writes a program that prints the alphabet in lowercase, followed by a new line.
3. alphABET 3-print_alphabets.c Writes a program that prints the alphabet in lowercase, and then in uppercase, followed by a new line.
4. When I was having that alphabet soup, I never thought that it would pay off 4-print_alphabt.c Writes a program that prints the alphabet in lowercase, followed by a new line, except q and e.
5. Numbers 5-print_numbers.c Writes a program that prints all single digit numbers of base 10 starting from 0, followed by a new line.
6. Numberz 6-print_numberz.c Writes a program that prints all single digit numbers of base 10 starting from 0, followed by a new line, using only putchar and without using any variable of type char.
7. Smile in the mirror 7-print_tebahpla.c Writes a program that prints the lowercase alphabet in reverse, followed by a new line.
8. Hexadecimal 8-print_base16.c Writes a program that prints all the numbers of base 16 in lowercase, followed by a new line.
9. Patience, persistence and perspiration make an unbeatable combination for success 9-print_comb.c Writes a program that prints all possible combinations of single-digit numbers.
10. Inventing is a combination of brains and materials. The more brains you use, the less material you need 100-print_comb3.c Writes a program that prints all possible different combinations of two digits.
11. The success combination in business is: Do what you do better... and: do more of what you do... 101-print_comb4.c Writes a program that prints all possible different combinations of three digits.
12. Software is eating the World 102-print_comb5.c Writes a program that prints all possible combinations of two two-digit numbers.