LEVEL 2 C Language, Niveau 2 en langage C,

            The C language used in a higher level engineering     
                                     Applications

Introduction:

Using the C language in many engineering applications, especially in a lower levels development in electronics (analog and digital) and EDA Solutions.

In Medical development and research programs developing hardware microcontrollers (type Mplab using C language, type Atmel using assembly language, ARM microprocessors (C2H compiler and compilation, debugging using C language…).

 In industry line control and real time control by using labview, matlab functions with C programming parts (sensors control , sensors on/off switching, output time responses, stable testing functions).

Many and many applications in many fields.

Level 2 in C step by step together.


First program.   


Fig-1

1+Include is used in preprocessing functions, we define int: integer, float: for decimal numbers, double for high precision.
2+I defined 2 variables i, j using type int.
3+ printf: this function is used in showing data on the screen.
4+\n: new line, \t:tabulation, \a: alarm…


I = 1 intialisation, i : is the condition,
I: increasing until stop.

 




5+for (i=1; i<0; i++)




6+ return 0;

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Second program.


                                                                    Fig-2

Here in the second application is used in banks on unix or on linux operating systems,
Using account number, amount of money, code user, type of money, country,…
This project when the bank consultant inserting money in real time dynamic C, there is a file of word created at the end of all operations every 8 hours with all operations passed.
Here we defind, int, char, double, also File*cfptr.
If condition, else if condition…

…………………………………………………………………………………………………………………………………………………………………………

Third application:

The Possible Mathematical operations in C,


Fig-3


In this application we used the available math operations, with special coding in C,

1-   I put a variable with type int = 2.
2-    no+=4 , means that 2 + 4 = 6,  no-=3 this means 6 – 3 = 3 and so on,…
3- in the end the variable after all operations will give 2.

               
                                                           Fig-4
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

1-here we defined a menu, with 4 choices, and was using case  “instruction and break”.
2- Scan function to get a data input from the user, with defining that
The input will be int (entier ) by using %d.
3- after you choose your choice you will see the output.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Fifth application:



Fig-5

In this application I made a 4 levels of the game.
the user has to find the number who choosed randomly by the Computer.
First level between 1 and 100, second level between 1 and 1000,…
So if there are 3 users and they have to try to find the number choosed by random way, so the user quickly find it, he will be the winner.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6th application, Six application:
+ firstly we have our main file(page .c/.c++)
+secondly we made a new file with the same name (.h)
+thirdly we test our function developed in the H-file(contains prototypes, define, constants,…)
+fourthly you will see the output between the main.c and file.h


Fig-6a

Now to complete our project we use the function or using and calling the prototype defined in the tester14.h, so we put a printf fonction with incremente(),

hope you can print until 8 or 100 or as you like the ouput is on the black screen.

Using .c and .h is the main fonctions to build any large programs in many applications.



Fig-6-b

Now to complete our project we use the function or using and calling the prototype defined in the tester14.h,

so we put a printf fonction with incremente(),

hope you can print until 8 or 100 or as you like the ouput is on the black screen.
Using .c and .h is the main fonctions to build any large programs in many applications.


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Fig- 7-a

In this Seventh application:

I will introduce for you a program using pointers and calling pointers.
Pointers are used in our programs to access memory or to reserve a part of the memory for our data programming types and values.

1+ In this application you can see monpointer, p1, p2, P3 as pointers using *name and this is the definition used in C language for pointers.

2+ I defind a variable age, and I defined a pointer called psurage.

3+ after that in the function of the printf(), I print or put on the screen output the addresses(or it’s place in the memory as you see).
                                         
Fig -7-b

Now you can see my friends how addressing and putting data in the memory and how can I will call it.

So the same program put after calling the pointer, and defining with register a place in the memory, I put in it the value of age, and I will call it from it’s place in the memory by *psurage.

Thank you my friends hope you can use this second level in developing by C language many good applications for engineers and engineering higher technologies.

We build for you fruits of light developping engineering and technologies
 hope you are living in joy and build for others in many good applications.

Please use this corses in electronics and  in programming in good engneering applications,  in peace , good light things.

For lightening minds and practices.

From Me.

Commentaires

Posts les plus consultés de ce blog

MATLAB and using matlab, utilisation de matlab, die arbiten für Matlab koncepten,

Modeling automatic systems using Matlab-simuliunk level 24

Développement informatique HTML