Homepage » c programlama dersleri

Articles for c programlama dersleri

C / C++ »

[6 Sep 2011 | No comments | 1,733 views ]
C / C++ Courses ? 13 (Switch)

Switch is a selection structure just like if, if/else. It is not a repetition structure. Important points of using switch:
? We use switch while checking one variable with different outcomes with more than one value.

? It should be equality. Comparison (< or >) won’t work with switch.

? In switch, only integer can be used, not other types. But character is also acceptable, because as you know, character has also an integer value which is ASCII code. So we can say,

Read the rest.. »

C / C++ »

[5 Sep 2011 | No comments | 1,666 views ]
C / C++ Courses ? 12 (Do/While and Comparison of Loops)

After a long time, i have started to continue this course. Because i got some mails which want me to complete this course. Even if there is someone who benefits this course, it is enough for me to be willing to continue. Let’s continue then;)


Let’s try one example with 3 different loops that we have learned before. Also this example will remind us how to use loops.

(1) int x=1;

while(x<=10){ ...

Read the rest.. »

C / C++ »

[25 Dec 2010 | 2 Comments | 1,939 views ]
C / C++ Courses ? 10 (Pre-increment and Post-increment)

Pre-increment and Post-increment

Pre-increment changes the value of the variable, and then makes the calculation or processes which should be done. (It?s written like this: ?++x ?)

Post-increment makes the processes and then changes the value of the variable. (It?s written like this: ?++x ?)

Decrement versions of these are the same. (?–x? or? x–?)

int x=3;

printf(?%d?, ++x); //it will change the value of x to 4 and then print 4…

Read the rest.. »

C / C++ »

[29 Oct 2010 | 5 Comments | 2,300 views ]
C / C++ Courses ? 7 (Review and Continue with If Statements)

Let?s start with an example to remember previous course.

Write a program that enters a final grade of student and prints if the student passed or failed. (40 and above passed)


int main(){

int grade;

printf(?Enter the grade: ?);



Read the rest.. »

C / C++ »

[3 Aug 2010 | 1 Comment | 2,438 views ]
C / C++ Courses ? 6 (Conditions – If Statements)

They are used to compare some values and operate according to result.

The result can be true or false.

* If the condition is true, it operates everything in if statement.
* If the condition is false, it skips whole if statements and continue.

We can build conditional statements in two forms:

Read the rest.. »

C / C++ »

[3 Aug 2010 | 4 Comments | 1,882 views ]
C / C++ Courses ? 5 (Calculations)

Let’s continue with calculation in C!
First of all, we should know about order of mathematical operations. Basicly, we can say the order is like that:
1) ( ) paranthesis
2) * (product), / (division) , % (remainder of division)
3) + (summation), – (difference)
If operations are in the same order ( like + and – ), than the priority belongs to one that comes first.
int x= 5 * 4 / 2 + ( 4 + 2 );
If we print, it will find x …

Read the rest.. »

C / C++ »

[26 Jul 2010 | 2 Comments | 2,167 views ]
C / C++ Courses ? 4 (Execution & Input)

Let’s start!
To write and execute a program:

Edit : writes codes of the program on a suitable platform
It creates a file which has “cpp” extension. For example: “First.cpp”
Preprocess : adds header files and then checks for errors before compiling
Compile :

checks for syntax errors
converts program code into object code(machine language code)

At this point, “First.cpp” becomes “First.obj”
Link : makes object code and files in preprocessing work together
Load : loads program into memory (CPU will take instructions)
Execute : runs every line in memory, but …

Read the rest.. »

C / C++ »

[23 Jul 2010 | 1 Comment | 2,068 views ]
C / C++ Courses ? 3 (Variables)

Let’s talk about variables and usage of conversion specifiers now.
What is a variable?

* It’s a location in memory
* It’s used to store input and results. (Results can be output as well)
* It has a name and a data type
* We specify the location in memory by declaring

Three things that we can do with variables are declaration, initialization and using it.If you use a variable without declaring it, it will give you an error “undeclared identifiers”.

Read the rest.. »

C / C++ »

[22 Jul 2010 | Comments Off on C / C++ Courses ? 2 (Output, Escape Characters & Comments) | 1,508 views ]
C / C++ Courses ? 2 (Output, Escape Characters & Comments)

Let’s continue to refresh our minds:

The first function that we should know is printf function..

This function is used for output. The usage of this function is so simple.

Whatever you want to write as output on the screen, you can put this between quotation marks (” “)

printf(” (Things that you want to see on the screen will be here) “);

Read the rest.. »

C / C++ »

[19 Jul 2010 | 2 Comments | 1,938 views ]
C / C++ Courses ? 1 (Introduction to C)

Let’s start with memories. There are two kinds of memory:

Temporary Memory: Also called “Primary Memory“. When we say temporary memory, RAM comes to our minds. It contains little space, but it is expensive.
Permanent Memory: Also called “Secondary Memory“.You know this is related to Hard Disc. It needs more space, but it is cheaper than temporary memory.

This theoratical information is enough for now. Let’s make a quick start to programming. The basic terms that a C Program should have, …

Read the rest.. »