iasteele

 

Jan

Page history last edited by Jan 2 yrs ago
C++ programing
beginn:
#include <stdio.h>

#include <stdlib.h>

those you need to open the library and the in and output
void main()
to starts the main application
Variable tybes:
integers(int)                       :single numbers withotu decimals (1,2,3,4,5,.......)    
characters(char)               :single letters (a,b,c,d,......)
floating numbers(float)    :numbers with decimals (1.2 ;4.3 ;5.6 ;......)
string(string)                      :array of charracters (abcd; djhkhk;......)
printing on screen:
to tell the program to print something on the screen you have to write the the word : printf (" enter text here ")
to print an variable use %i for example printf(" your first number is equal to %i"  ) to tell the program what the variable is write the variable you want to you use behind the the "
for example  printf("your first number is = %i",x).    x is the variable
scanf:
scanf is used to tell the computer a variable. it reads the variable the use types in. for example scanf("%i",&x); with this the variable x get's defined.
arrays
a array of characters for example int numbers[10];  which means that it edited ten of this characters
Loops:
while:
the program which is written in the brakkets will be repeated as long as the answer is right.
for :
(int = something ,int > something , int = int + something);
end
to end the you have to write while(1); to finish (only in class, this isn't need in the real world ever never)

 

Comments (0)

You don't have permission to comment on this page.