Write a routine to implement the polymarker function



Write a routine to implement the polymarker function..

Answer / Nilesh Nishant

Here's an example of a polymarker function in C:nnvoid polyMarker(int x, int y, int size, int n_points) {n int i, j;n for (i = 0; i < n_points; i++) {n int a = i * (size / n_points);n for (j = -a; j <= a; j++) {n int x_coord = x + j;n int y_coord = y + size - abs(j - a);n printf("%d %d
", x_coord, y_coord);n }n }n}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { clrscr(); } clrscr();

2 Answers  


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

1 Answers  


main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

2 Answers  


main() { extern int i; i=20; printf("%d",sizeof(i)); }

2 Answers  


Who could write how to find a prime number in dynamic array?

1 Answers  


char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 Answers  


Is it possible to type a name in command line without ant quotes?

1 Answers   Excel, Infosys,


what is the output of following program ? void main() { int i=5; printf("%d %d %d %d %d ",i++,i--,++i,--i,i); }

10 Answers  


C statement to copy a string without using loop and library function..

2 Answers   Persistent, TCS,


main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }

1 Answers   TCS,


main() { int i=5; printf(“%d”,i=++i ==6); }

1 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


Categories