C Programs
C Programs
Algorithm:
Step 1: Start
Step 2: Read a, b
Step 3: if a > b then
3.1 print a
Step 4: else
4.1 print b
Step 5: Stop
Flow chart:
Flow chart:
Algorithm:
Step 1: Start
Step 2: Read ch
Step 3: c=(ch==’a’||ch==’e’||ch==’i’||ch==’o’||ch==’u’
||ch==’A’||ch==’E’||ch==’I’||ch==’O’||ch==’U’)
Step 4: if (c) then
3.1 print “Given character is vowel”
Step 5: else
4.1 print “Given character is consonant”
Step 6: Stop
Flow chart:
Algorithm:
Step 1: Start
Step 2: Read year
Step 3: if ((((year % 4 == 0) && (year % 100! = 0)) || (year%400 == 0))) then
3.1 print “Given year is leaf year”
Step 4: else
4.1 print “Given year is not a leaf year”
Step 5: Stop
Flow chart:
Algorithm:
Step 1: Start
Step 2: Read a,b
Step 3: a=a+b
Step 4: b=a-b
Step 5: a=a-b
Step 6: print a,b
Step 7: Stop
Flow chart:
#include<stdio.h>
void main()
{
int dec;
printf("Enter the Decimal Number :");
scanf("%d",&dec);
printf(" The Octal Number is : %o\n",dec);
printf(" The Hexadecimal Number is : %x\n",dec);
}
Algorithm:
Step 1: Begin
Step 2: Enter samt value.
Step 3: if ( samt < 5000 ) then
3.1 : Compute comm = samt * 5/100 goto step 5
Step 4: else
4.1 : Compute comm = 250 + samt * 8/100
Step 5: Print comm value
Step 6: End
Flow chart: