0% found this document useful (0 votes)
26 views4 pages

10 Practice Problems ICS (F)

Uploaded by

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

10 Practice Problems ICS (F)

Uploaded by

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

ICS CSE 110 SUMMER 2024

SECTION F

Practice Problems

1.Write a C program where you will declare four integer variables (say a, b, c and d),
initialize them by values of your choice, and calculate a * b + (a – c) / d + b.

Sample input Sample output


21 * 15 + (21 – 34) / 6 + 15 = 327

2. Write a C program where you will declare two integer variables, input them using scanf,
and perform the basic arithmetic operations on them.

Sample input Sample output


18 7 18 + 7 = 25
18 – 7 = 11
18 * 7 = 126
18 / 7 = 2
18 % 7 = 4

3. Write a C program which will calculate the terminal velocity of a moving body
by using the following equation:
v=u+at

You have to take as input u, a and t in order. Can you figure out the data types for all
the variables?

Sample input Sample output


5 6 12 v = 77
4. Write a C program to find the sum of two float numbers. Two float numbers
will be provided by the user from the keyboard.

Sample Input Sample Output

1.25 4.75 6.0

23.05 41.16 64.21

5. Program that will evaluate the following equations -


X=a–b/3+c*2–1
Y = a – ( b / ( 3 + c ) * 2) - 1
Z = a – ( ( b / 3) + c * 2) - 1

Sample input (a, b, c) Sample output


9 12 3 X = 10
Y=4
Z = -1

6. Program that will define a constant using “CONST” and print the value.

Sample input Sample output


The value of pi: 3.14
The value of golden ratio: 1.62

7. Write a C program to find the ASCII code of a given character.

Sample Input Sample Output

A 65

e 101

E 69
8. Write a C program to convert an uppercase character into lowercase. User will provide
an uppercase character from the keyboard.

Sample Input Sample Output

M m

R r

9.
Write a C program to find the sum of two integer numbers with a complete
user experience.

Sample-1:

To find the sum, you have to provide two integers

Enter the first integer:

10

Enter the second integer:

20

The sum of 10 and 20 is: 30

Sample-2:

To find the sum, you have to provide two integers

Enter the first integer:

75

Enter the second integer:

27

The sum of 75 and 27 is: 102


10. Write a C program to identify the vowel from the input characters. If there are no
vowels, print the sample message.

Sample Input Sample Output

am a

qr No vowels

You might also like