1 / 9

EXERCISE IN CLASS

EXERCISE IN CLASS. CHAPTER 3. PART 1. IDENTIFIER. SCENARIO 1. record1 1record file_3 return $ tax Name name and address name-and-address name_and_address 123-45-6789. Determine which of the following are valid identifiers. If invalid , explain why. SCENARIO 2.

tamika
Télécharger la présentation

EXERCISE IN CLASS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EXERCISE IN CLASS CHAPTER 3

  2. PART 1 IDENTIFIER

  3. SCENARIO 1 • record1 • 1record • file_3 • return • $tax • Name • name and address • name-and-address • name_and_address • 123-45-6789 Determine which of the following are valid identifiers. If invalid, explain why.

  4. SCENARIO 2 #include <stdio.h> void main() { int1st, second, third; float fun, Fun; char x, initial name, my-name; Second = 8; Fun=10.2 fun = x; } Trace all the syntax error(s) in below program:

  5. PART 1 BASIC DATA TYPE

  6. SCENARIO 1 Write appropriate declarations and assign the given initial values for each group of variables: • Floating-point variables: a = -8.2, b = 0.005 • Integer variables: x = 129, y = 87, z = -22 • Character variables : c1 = ‘w’, c2 = ‘&’

  7. SCENARIO 2 Identify the syntactic errors in the following program. Then rewrite the correct program. #include <stdio.h> void main() • { integer a; • floating-point b; • character c; • printf(“End.”); }

  8. SCENARIO 3 • Write the #define preprocessor directive for a program that has the constant macro HOURLY_WAGES (5.50). • Rewrite the following program that uses variables with memory constants. • #include<stdio.h> • void main() • { float weight = 30.5; • intproduct_code = 1000;}

  9. THAT’S ALL FOR TODAY……SEE YA NEXT CLASS 

More Related