How to write a program that asks the users to enter two integers, obtains the numbers from user, then prints the larger number followed by the words "is larger", if the numbers are equal, print the message "these are equal". use only the single-selection form of the if statement.
aria12
0
Newbie Poster
Recommended Answers
Jump to Postit can be done by using "if"conditional statemnts
Jump to Postya here is the desired programme
#include<stdio.h>
main()
{
int a,b;
printf("enter the values to be compared");
scanf("%d %d",&a,&b);
if(a>b)
printf("%d is larger than %d",a,b);
else
printf("%d is smaller than %d",a,b);
}
Jump to PostI don't have one, the opening poster does. On my first read I didn't really understand the way the question was presented and assumed this was a first project; I asked if the person knew the basics. Did you get offended or something?
To be honest it looked like …
All 10 Replies
cindrilla
0
Newbie Poster
cindrilla
0
Newbie Poster
Kamatari
1
Light Poster
cindrilla
0
Newbie Poster
Kamatari
1
Light Poster
vinitmittal2008
commented:
keep it up!!
+1
aria12
0
Newbie Poster
vinitmittal2008
37
Junior Poster
Kamatari
1
Light Poster
aria12
0
Newbie Poster
aria12
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.