Make a c program that asks the users to enter two numbers. Then, get the total and Display “I LOVE MY PARENTS” if the sum is more than or equal to 25, otherwise Display “I WILL NEVER GIVE UP” and show which number is greater and lower.
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
/*
Make a c program that asks the users to enter two numbers.
Then, get the total and Display “I LOVE MY PARENTS” if the sum is more than or equal to 25,
otherwise Display “I WILL NEVER GIVE UP” and show which number is greater and lower.
*/
int main()
{
int a,b;
printf("\n\tEnter a = "); scanf("%d",&a);
printf("\n\tEnter b = "); scanf("%d",&b);
if(a+b>=25) printf("\n\tI LOVE MY PARENTS");
else printf("\n\tI WILL NEVER GIVE UP");
if(a>b) printf("\n\ta (=%d) is greater than b(=%d)",a,b);
if(a<b) printf("\n\tb (=%d) is greater than a(=%d)",b,a);
if(a==b) printf("\n\ta == b == %d",a);
return(0);
}
Comments
Leave a comment