0% found this document useful (0 votes)
28 views1 page

Algorithm, Flow Chart and Code For C

Uploaded by

Mehedi Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

Algorithm, Flow Chart and Code For C

Uploaded by

Mehedi Hasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Problem: Read two integers from the user.

Your program should then print “first is greater” if the first


number is greater, and “first is not greater” otherwise

Algorithm:
Step 1: Start
Step 2: Input two integers
Step 3: Check First is greater.
Step 4: Print “First is greater”.
Step: 5: If Step 3 is false then print “First is not greater”
Step 6: Stop

Code for C:
#include<stdio.h>
main()
{
// Declare variable
int fn, sn;
//Input two number at a time
printf("Enter two integers: ");
scanf("%d %d",&fn, &sn);
//Check first number is greater or not
if (fn>sn)
{
printf("First is greater");
}
else
{
printf("First is not greater");
}
//No return value
return 0;
}

You might also like