Computer programming theory_1

780
-1

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
780
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Computer programming theory_1

  1. 1. Khalid Rasheed Shaikh Computer Programming Theory 1
  2. 2. Programming Environment <ul><ul><li>Command Line  </li></ul></ul><ul><ul><li>IDE (Integrated Development System) </li></ul></ul>
  3. 3. Library and Run-Time Files <ul><ul><li>library Files </li></ul></ul><ul><ul><li>Math Library </li></ul></ul><ul><ul><li>Run-Time Object Files </li></ul></ul><ul><ul><li>Header Files </li></ul></ul><ul><ul><li>Programmer Generated Files </li></ul></ul>
  4. 4. Writing a program <ul><li>  </li></ul><ul><ul><li>void main(void){ </li></ul></ul><ul><li>        printf(&quot;I can speak German&quot;); </li></ul><ul><li>     } </li></ul><ul><ul><li>    Saving Programe </li></ul></ul><ul><ul><li>Making an .EXE </li></ul></ul><ul><ul><li>Compiling </li></ul></ul><ul><ul><li>Linking </li></ul></ul><ul><ul><li>Executing a Program </li></ul></ul>
  5. 5. Errors <ul><ul><li>Syntax Errors </li></ul></ul><ul><ul><li>Logical Errors </li></ul></ul>
  6. 6. Basic Structure of C programs <ul><ul><li>Function Definition </li></ul></ul><ul><ul><li>Delimiters </li></ul></ul><ul><ul><li>Statement Terminator </li></ul></ul><ul><ul><li>Program Style, Round One </li></ul></ul><ul><ul><ul><li>void main(void){ printf(&quot;Hello&quot;);} </li></ul></ul></ul>
  7. 7. The printf Function <ul><li>  </li></ul><ul><li>printf(&quot;My First C Program&quot;); </li></ul>
  8. 8. Exploring the printf function <ul><ul><li>Printing Numbers </li></ul></ul><ul><ul><ul><li>printf(&quot;Number: %d&quot;, 2) ; </li></ul></ul></ul><ul><ul><li>Format Specifiers </li></ul></ul><ul><ul><li>Printing String </li></ul></ul><ul><ul><ul><li>printf(&quot;$s is an %s&quot; 2, &quot;int&quot;) </li></ul></ul></ul><ul><ul><li>Printing Characters </li></ul></ul>
  9. 9. Variables <ul><ul><li>Constant and Variables </li></ul></ul><ul><ul><ul><li>Defining </li></ul></ul></ul><ul><ul><ul><li>Declaring </li></ul></ul></ul><ul><ul><ul><li>Assigning </li></ul></ul></ul>
  10. 10. Variables Type <ul><ul><li>int </li></ul></ul><ul><ul><li>  char </li></ul></ul><ul><ul><li>float </li></ul></ul><ul><ul><li>double </li></ul></ul>
  11. 11. Input / Output <ul><li>float flt = 2.3; </li></ul><ul><li>printf(&quot;%.1f&quot;, flt); </li></ul>
  12. 12. The scanf() Function <ul><li>float years, days; </li></ul><ul><li>printf(&quot;Enter age in Years&quot;); </li></ul><ul><li>scanf(&quot;%f&quot;,&years); </li></ul><ul><li>days = years*365; </li></ul><ul><li>printf(&quot;Your age is %.1f&quot;, days) </li></ul>
  13. 13. The Address Operator (&) <ul><li>scanf(&quot;%f&quot;,&years); </li></ul><ul><li>printf(&quot;Address = %d, value = %f &quot;, years, &years); </li></ul>
  14. 14. Operators <ul><ul><li>Arithmetic Operators </li></ul></ul><ul><ul><li>Operator Precedence </li></ul></ul><ul><ul><ul><li>(B)rackets, (O)rder, (D)ivision, (M)ultiplication, (A)ddition, (S)ubtraction </li></ul></ul></ul><ul><ul><li>The Reminder Operator </li></ul></ul><ul><ul><ul><li>answer = 13 % 5; </li></ul></ul></ul><ul><ul><li>  Expression Vs Variables </li></ul></ul><ul><ul><ul><li>days = years * 365 </li></ul></ul></ul><ul><ul><li>Arithmetic Assignment Operators </li></ul></ul><ul><ul><li>Increment operators </li></ul></ul><ul><ul><li>Relational operators </li></ul></ul>

×