Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Question!


Name: muhammad
Title:
  draw without graphics.h
Question:
I have home work which is to draw line ,circle 
I wrote this code and don't know if it is true or false 




#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>
#include<math.h>
draw_line(int a,int b){
    int y;int x=3;
    for(x=-2;x<=2;x  )
{
    y=a*x b;
    moveto(x,y);

    printf("*");
}



}

draw_circle(a,b,r){
    float newx;float newy;
float pi=2;float radians;
for(radians=0;radians<2*pi;radians =0.1)
{
     newx=a cos(radians)*r;
     newy=b sin(radians)*r;
      /* display code */
      moveto(newx,newy);
      printf("*");
}



}



int main()
{int fig_code;int x; int y; int a; int b; int radius;
    printf("select shape you wish to draw\n1-Line\n2-circle\n");
scanf("%i",
Answers: