GithubHelp home page GithubHelp logo

c-scripts's Introduction

Intro to algorithms class

Types of programming languages

Variables

Are used to store values with a specific name To use a variable we need to declare it first, at the beginning of our program, the sintax is type [name]; Example:

int age;
char option;
float bmi;

You can also assign a value to the variable in two ways: at the moment of declaring or later:

int age;
age = 19; // stores the value 19 inside the var "age"

float bmi = 21.76; // declares the var bmi and assigns directly its value

Now you can use variables inside your program in a specific scope, but that is another topic. For the while, use it inside a function or your main function.

Functions

Functions are a pretty way to optimize the code inside your program. They are used to avoid repeating code. Basically, when you have a piece of code that is being repeated several times in your program: you're doing sth wrong. The advantajes of functions is that you can use them many times as you want with different parameters.

You can declare a new function is your programs as: returning_type [name_of_your_function] (params)

Example of a function that will return the square of a number:

// a fucntion that returns an int value
int function square(int num) {
	return num*num; // return is important
}

Now you can use yor square function with different arguments as:

int a = square(4); // returns 16
int b = square(3); // returns 9
int c = square(8); // returns 64

Pointers

Arguments

Bash commands

Git

c-scripts's People

Contributors

alejandro-medina avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.