Algorithm, Flow Chart and Code For C
Algorithm, Flow Chart and Code For C
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;
}