c
play

C Session # 6 By: Saeed Haratian Fall 2015 Outlines Data Types - PowerPoint PPT Presentation

Fundamentals of Programming C Session # 6 By: Saeed Haratian Fall 2015 Outlines Data Types Operators Type Conversion Formatted Input / Output Some Useful Functions Structured Programming Data Types unsigned char 8


  1. Fundamentals of Programming C Session # 6 By: Saeed Haratian Fall 2015

  2. Outlines  Data Types  Operators  Type Conversion  Formatted Input / Output  Some Useful Functions  Structured Programming

  3. Data Types unsigned char 8 bits 0 to 255 signed char 8 bits -127 to 127 char 8 bits unsigned short int 16 bits 0 to 65535 signed short int 16 bits -32767 to 32767 short int 16 bits unsigned long int 32 bits 0 to 4294967295 signed long int 32 bits -2147483647 to 2147483647 long int 32 bits int

  4. Data Types … float 32 bits 7 digits 10 -38 to 10 +38 double 64 bits 15 digits 10 -308 to 10 +308 long double 80 bits 19 digits 10 -4932 to 10 +4932

  5. Operators ( ) ! ~ ++ -- * / % + - << >> <<= >>= == != & ^ | && || ? = += -= *= /= %=

  6. Type Conversion  char  short int  int  long int  float  double  long double

  7. printf : Format Characters %d %i Decimal Integer %u Unsigned Decimal Integer %o Unsigned Octal %x Unsigned Hexadecimal ( Small Letters ) %X Unsigned Hexadecimal ( Capital Letters ) %w.dd

  8. printf : Format Characters … %f %g Decimal Floating Point %e Scientific with 'e' %E Scientific with 'E %w.df %c One Character %s Character String %w.ds

  9. printf : Escape Sequence \f New page \n New Line \t Tab \" " \' ' \\ \ \N Octal Constant \xN Hexadecimal Constant

  10. Useful Functions  clrscr ( )  gotoxy (x,y)  getch ( )  getche ( )  getchar ( )  putch ( ch )  putchar ( ch )

  11. Structured Programming  During the 1960s, it became clear that the indiscriminate use of transfers of control was the root of a great deal of difficulty experienced by software development groups.  The finger of blame was pointed at the goto statement that allows programmers to specify a transfer of control to one of many possible destinations in a program.  The notion of so-called structured programming became almost synonymous with “ goto elimination. ”  Research had demonstrated that programs could be written without any goto statements.

  12. Structured Programming …  The challenge of the era was for programmers to shift their styles to “ goto-less programming. ”  The results were impressive, as software development groups reported reduced development times, more frequent on-time delivery of systems and more frequent within-budget completion of software projects.  Programs produced with structured techniques were clearer, easier to debug and modify and more likely to be bug free in the first place.  Research had demonstrated that all programs could be written in terms of only three control structures, namely the sequence structure, the selection structure and the repetition structure.

  13. Any Questions?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend