Skip to content

CPRF-Session2/Assignment1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Assignment 1

Objectives

Get comfortable with simple output, variables, and data types by practicing them in a simple program. Learn how to submit assignments on GitHub.

Part 1

Write a program initials.c to print your initials formed by rows of pound signs. For instance:

      ###         ###     ###
      ###         ###     ###
      ###         ###     ###
      ###         ###########
      ###         ###     ###
      ###         ###     ###
      #########   ###     ###

Part 2

In a text file assignment1.txt, answer the following questions:

  1. What is a compiler? Explain thoroughly and in your own words.

  2. Are the following errors compile time errors or runtime errors? Why? Explain the difference.

    a.

      int x = 2
    

    b.

      float 1num = 3.0;
    

    c.

      double num  = 4.0 / 0.0;
    
  3. What, if anything, is wrong with the following code?

     #include <stdio.h>
     void main() {  
         float x = 41.5;  
         printf("The value of x is %d", x);
         Return 0;
     }  

Submission Requirements

Please include your name and a description in a comment at the top of your code files. Please also include your name at the top of your assignment1.txt file.

All files must be submitted via GitHub by 10:00am 7/21.

Releases

No releases published

Packages

No packages published