0% found this document useful (0 votes)
34 views2 pages

Expected Output:: Assignment 3

1. The document contains 5 programming assignments in C: 1) Display if an integer is positive, negative or zero. 2) Find the largest of 3 numbers. 3) Calculate total, percentage and division of student marks in 3 subjects. 4) Display temperature state based on centigrade range. 5) Check if an alphabet is a vowel or consonant.
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)
34 views2 pages

Expected Output:: Assignment 3

1. The document contains 5 programming assignments in C: 1) Display if an integer is positive, negative or zero. 2) Find the largest of 3 numbers. 3) Calculate total, percentage and division of student marks in 3 subjects. 4) Display temperature state based on centigrade range. 5) Check if an alphabet is a vowel or consonant.
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/ 2

Assignment 3

1. Write a C program to read the value of an integer m and display the value of n is 1 when m is
larger than 0, 0 when m is 0 and -1 when m is less than 0. 
Test Data : -5
Expected Output :
The value of n = -1

2. Write a C program to find the largest of three numbers. 


Test Data : 12 25 52
Expected Output :
1st Number = 12,        2nd Number = 25,        3rd Number = 52
The 3rd Number is the greatest among three

3. Write a C program to read roll no, name and marks of three subjects and calculate the total,
percentage and division. 
Test Data :
Input the Roll Number of the student :784
Input the Name of the Student :James
Input the marks of Physics, Chemistry and Computer Application : 70 80 90
Expected Output :
Roll No : 784
Name of Student : James
Marks in Physics : 70
Marks in Chemistry : 80
Marks in Computer Application : 90
Total Marks = 240
Percentage = 80.00
Division = First

4. Write a C program to read temperature in centigrade and display a suitable message according
to temperature state below : 
Temp < 0 then Freezing weather
Temp 0-10 then Very Cold weather
Temp 10-20 then Cold weather
Temp 20-30 then Normal in Temp
Temp 30-40 then Its Hot
Temp >=40 then Its Very Hot
Test Data :
42
Expected Output :
Its very hot.

5. Write a C program to check whether an alphabet is a vowel or consonant. 


Test Data :
k
Expected Output :
The alphabet is a consonant.

You might also like