0% found this document useful (0 votes)
11 views

Cat I

Uploaded by

hlestakovjames
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Cat I

Uploaded by

hlestakovjames
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

INTRO COMPUTER PROGRAMMING

A. Briefly describe the three main types of constants (3 Marks)


B. Re-write the following code sample using a while loop.
int x=0;
int y=5;
do
{
cout<<”statement1”<<end;
y++;
}while(x<y); (3 Marks)
C. Define the term literal (1 Mark)
D. State any two rules followed in the naming of variables in C Programming. (2 Marks)
E. Write a program that prompts the user to enter the radius of a circle.
The program should then compute both the area and circumference of a circle. PI should
be declared as a constant. (8 Marks)
F. Write a C program that will be able to produce the following result shown below. The
program should accept only numbers between 1 and 10. (6 Marks)
Output of the program will appear as:
This program prompts you to enter 5 numbers
Each number should be from 1 to 10
Enter number 1 of 5: 3
Enter number 2 of 5: 6
Enter number 3 of 5: 3
Enter number 4 of 5: 9
Enter number 5 of 5: 2

Value 1 is 3
Value 2 is 6
Value 3 is 3
Value 4 is 9
Value 5 is 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy