Fundamental Types - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Fundamental Types

Description:

... Types. What type of C Object is used to represent real numbers? ... Write a program to accept temperature expressed in Fahrenheit and convert it to Celsius ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 11
Provided by: ksho9
Category:

less

Transcript and Presenter's Notes

Title: Fundamental Types


1
Fundamental Types
  1. What type of C Object is used to represent real
    numbers?
  2. What type of Object is used for letters?

2
Escape Sequences
  1. What is the C escape sequence for including a
    double quote in a string?
  2. What is the C escape sequence for a tab
    character?
  3. What numeric form is used for general escape
    sequences?

3
Object Names
  • Which of the following are invalid object names
  • GPA
  • Grade.Pnt
  • GradePntAve
  • 1stNum
  • X-Ray
  • R2D2
  • 3CPO
  • Ave_Cost
  • int
  • cost
  • first name

4
Strings
  • How many null bytes in the string Whatever\0

5
String Operators
  • Give the output of the following code fragment
  • string time 1115
  • time PM
  • cout ltlt time ltlt endl

6
String Functions
  • Give the output of the following code fragement
  • string s Beam Me Up Scotty
  • cout ltlt s.substr(5, 2) ltlt endl

7
Expressions
  • What are the results of the expressions. Express
    as ltvalue, typegt
  • 25/7
  • 21/3
  • 143
  • 24.0/4.0
  • Given X 4 X 6
  • Given Y 3 Y /3
  • Given J 2 J ! 3

8
Expressions
  • Why is the following code fragment illegal?
  • int x 5
  • int y
  • int z
  • (z y) x

9
Programming
  • Write a program that reads an elapsed time in
    hhmmss format and computes the elapsed time in
    seconds.

10
Programming
  • Write a program to accept temperature expressed
    in Fahrenheit and convert it to Celsius
  • Conversion is C 5/9(F 32)
Write a Comment
User Comments (0)
About PowerShow.com