X & Y intercepts program in C

#include<stdio.h>
int main()
{
int m,c,x,y;
printf(“Enter the value of m\n”);
scanf(“%d”,&m);
printf(“Enter the value of c\n”);
scanf(“%d”,&c);
printf(“The line equation is y=%dx+%d\n”,m,c);
y=m*0+c;
x=-c/m;
printf(“The x intercept is %d\n”,x);
printf(“The y intercept is %d\n”,y);
return 0;
}

Leave a Reply