PPS LAB

Program to enter 3 angles & check whether a triangle is possible or not in C

Logic: A triangle is possible only if, sum of all three angles is 180 Algorithm Enter angles of triangle as a,b,c s = a+b+c; if(s==180) printf(“triangle is possible”); else printf(“triangle is not possible”); Program #include <stdio.h> int main() { printf(“*************************************************************”); printf(“\n*************************************************************”); printf(“\n** WAP to enter 3 angles & check if a triangle is possible**”); printf(“\n** …

Program to enter 3 angles & check whether a triangle is possible or not in C Read More »

Program to enter 3 sides & check whether a triangle is possible or not in C

Logic: A triangle is possible only if, sum of any two sides is greater than third side. Algorithm Enter sides of triangle as a,b,c s = a+b; if(s>c) printf(“triangle is possible\n”); else printf(“triangle is not possible”); Program #include <stdio.h> int main() { printf(“*************************************************************”); printf(“\n*************************************************************”); printf(“\n** WAP to enter 3 sides & check if a triangle …

Program to enter 3 sides & check whether a triangle is possible or not in C Read More »

Program to convert temperature from farenheit to celcius or vice versa in C

Logic: Formula for temperature conversion is: C=(F-32)*5/9 F=9/5 * C +32 Algorithm Enter choice ch if (ch == 1) { printf(“enter the value of temperature in Celcius\n”); scanf(“%f”, &celcius); f = (celcius * 9 / 5) + 32; printf(“the value of temperature in fahrenheit is %f”, f); } else { printf(“enter the value of temperature …

Program to convert temperature from farenheit to celcius or vice versa in C Read More »

Program to calculate discount based on bill of items purchased in C

Program #include<stdio.h> int main() { printf(“*******************************************”); printf(“\n*******************************************”); printf(“\n**WAP to calculate discount based on bill**”); printf(“\n** using if else if laddar **”); printf(“\n** Created by Sheetal Garg **”); printf(“\n** Assistant Professor **”); printf(“\n** Phone No:9467863365 **”); printf(“\n*******************************************”); printf(“\n*******************************************\n”); float price, quan, dis, bill, netpay; printf(“enter quantity and price”); scanf(“%f%f”,&quan, &price); bill = quan*price; if(bill<500) dis=0; else …

Program to calculate discount based on bill of items purchased in C Read More »

Program to find total, percentage and grade of a student in C

Program #include <stdio.h> int main() { int phy, chem, bio, math, comp; float per; printf(“**********************************************************”); printf(“\n**********************************************************”); printf(“\n**WAP to find total percentage & grade of a student in C**”); printf(“\n** Created by Sheetal Garg **”); printf(“\n** Assistant Professor **”); printf(“\n** Phone No:9467863365 **”); printf(“\n**********************************************************”); printf(“\n**********************************************************”); /* Input marks of five subjects from user */ printf(“\nEnter five …

Program to find total, percentage and grade of a student in C Read More »

error: You can only copy the programs code and output from this website. You are not allowed to copy anything else.