Q1. Make a program that converts temperature from Fahrenheit to Celsius and Celsius to Fahrenheit on user choice using if else . Output is given below:
Hint : inside if or else calculate the formula then just show result
Q2. Make a program to tell horoscope of a person : ask his birth-date, sum its individual digits and on basis of following statics answer his fortune:
Hint : use if-else if-else, to add 2 and` 2 from above example we will apply following procedure:
int rem, date,sum; /*take variable*/
scanf("%d",&date); /*Let input be 22*/
rem=date%10; /*it will generate remainder 2 and store it in rem*/
date=date/10; /* It will store 2 inside date because 22/10=2.2 and .2 neglected because date is an integer variable*/
sum=rem+date; /*Now we have both no 2 and 2 individually and we will sum them to have date sum*/
Q3. Check whether year is leap or not. Hint: leap year is perfectly divisible by 4. Use if else
Q4. Make program to give commission to the seller from following table :
Seller has to enter his sell and your program will calculate his commission and show him.
Q5. Take input of 3 subjects marks (OUT OF 10), add them and convert them into pointer using following table:
Show the result 10 9 8 or fail (use only if).
Hint : inside if or else calculate the formula then just show result
Q2. Make a program to tell horoscope of a person : ask his birth-date, sum its individual digits and on basis of following statics answer his fortune:
Hint : use if-else if-else, to add 2 and` 2 from above example we will apply following procedure:
int rem, date,sum; /*take variable*/
scanf("%d",&date); /*Let input be 22*/
rem=date%10; /*it will generate remainder 2 and store it in rem*/
date=date/10; /* It will store 2 inside date because 22/10=2.2 and .2 neglected because date is an integer variable*/
sum=rem+date; /*Now we have both no 2 and 2 individually and we will sum them to have date sum*/
Q3. Check whether year is leap or not. Hint: leap year is perfectly divisible by 4. Use if else
Q4. Make program to give commission to the seller from following table :
Seller has to enter his sell and your program will calculate his commission and show him.
Q5. Take input of 3 subjects marks (OUT OF 10), add them and convert them into pointer using following table:
Show the result 10 9 8 or fail (use only if).
No comments:
Post a Comment