



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




/* some comments */
char x; /* x is a char variable / x = 'a'; / 'a' is a constant */
int x, y; /* two int variables / x = - 5000 ; / -5000 is an int constant */ y = 2021 ;
b t
num n = 3 | 5 ; /* variables can be initialized in its definition statement / num y = n * - 99 | 100 ; / numbers can be applied with math operations */
int x ; /* declare a variable of type int / char y ; num n = 3 | 5 ; num * np ; / np is a pointer to a num variable / np = &n; / &n computes the address of the num variable n */ int * xp = &x; char * yp; yp = &y;
2.3 Array
typeName arrayName [positive_int_const]
void print_message(char * arr); char greeting[ 80 ] = "How do you do."; print_message(greeting); /* array name can be used as an address of char */
2.4 String
int arr[ 8 ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 }; /* The missing part element is 0 / num arr2[] = { 1 | 2 , 2 | 3 , - 3 | 4 , - 4 | 5 , 50 | 99 } ; / an array of num with 5 elements */
2.7 Expressions
< ⤠> ā„ = =ī
2.8 Statements
num x; /* variable declaration /num arr[ 8 ]; /*array declaration */ void fun(num x); /function declaration */`
x = y + 3 ; /* expression statement / somefunction(void); / a function call is an expression*/
2.9 Input and output functions.
2.10 keywords
2.11 Program