You are on page 1of 1

#include<stdio.

h>
#include<conio.h>
#include<math.h>
int main()
{
int w,r,n,i;
printf("enter numberof values to be converted");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\n enter the valuein wcb");
scanf("%d",&w);
if(w<=90)
{
printf("\n the given is in first quadrant");
r=w;
printf("\n reduced bearing=N%dE",r);
}
else if(w<=180)
{
printf("\n the given is in second quadrant");
r=180-w;
printf("\n reduced bearing=S%dE",r);
}
else if(w<=270)
{
printf("\n the given is in third quadrant");
r=w-180;
printf("\n reduced bearing=S%dW",r);
}
else if(w<=360)
{
printf("\n the given is in fourth quadrant");
r=360-w;
printf("\n reduced bearing=N%dW",r);
}
else
{
printf("\n the given input is invalid");

}
}
getch();
}

You might also like