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

06 - C Basics - Revision 1

The document outlines a series of programming tasks and exercises focused on basic C programming concepts. It includes tasks for finding the greatest number, converting temperatures, calculating travel time, and working with loops to sum integers and find the smallest number. Additionally, it provides general revision tasks such as swapping numbers and printing patterns.

Uploaded by

rosahshhsh
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)
3 views

06 - C Basics - Revision 1

The document outlines a series of programming tasks and exercises focused on basic C programming concepts. It includes tasks for finding the greatest number, converting temperatures, calculating travel time, and working with loops to sum integers and find the smallest number. Additionally, it provides general revision tasks such as swapping numbers and printing patterns.

Uploaded by

rosahshhsh
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/ 5

C Basics

06 – Revision 1
From task

1. Write program that Finds the greatest number of three.

2. Converts a temperature in Celsius to Fahrenheit


according to the formula: F = 1.8 * C + 32.

3. Prompts the user for the distance between two cities


(in KM) and in what speed you intend to drive.

4. Print hours, minutes, seconds from given seconds.

5. print ASCII of char (or a keyboard key).

6. Get the age of someone.


Link to code: https://ideone.com/tIYRzE
On loops

1. Write a program that sums a sequence of integers. Assume that the first integer
read with scanf specifies the number of values remaining to be entered. Your
program should read only one value each time scanf is executed. A typical input
sequence might be 5 100 200 300 400 500 where the 5 indicates that the
subsequent five values are to be summed.

2. Write a program that finds the smallest of several integers. The first integer
entered is the number of integers, if we entered 5 100 200 300 400 500 the
output is 100.

3. Write a program that prints the following pattern using a single printf(“*”)
statement:

*
**
***
****
*****
General revision

1. Program to Swap Numbers (Using Temporary Variable).

2. Program to Swap Numbers (Without Using Temporary Variable).

3. Program that Finds the greatest number of three.

4. Program to print even numbers from 0 to 20.

5. Program to print odd numbers from 0 to 20.

6. Program to get two integers and sum all numbers between them.

7. Program to find the factorial of a number entered by user.


Next

You might also like