ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Code Snippets >> Programming Code >> C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions (401)
 C++ Code interview questions  C++ Code Interview Questions (121)
 VC++ Code interview questions  VC++ Code Interview Questions (2)
 Java Code interview questions  Java Code Interview Questions (58)
 Dot Net Code interview questions  Dot Net Code Interview Questions (113)
 Visual Basic Code interview questions  Visual Basic Code Interview Questions (8)
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions (37)
Question
how can u draw a rectangle in C
 Question Submitted By :: C-Code
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
Using a rectangle(int,int,int,int)function of c graphics. 
Is This Answer Correct ?    426 Yes 36 No
Ketan Bhavsar
 
Answer
# 2
using rectangle(int,int,int,int)
<left,top,right,bottom>
it is a function in graphics.h
 
Is This Answer Correct ?    225 Yes 20 No
M.d.balaji
 
 
 
Answer
# 3
using include<graphic.h> 
Is This Answer Correct ?    183 Yes 41 No
Soumya
 
Answer
# 4
USING rectangle(int,int,int,int)
it is a function in graphics.h
 
Is This Answer Correct ?    133 Yes 19 No
M.d.balaji
 
Answer
# 5
including graphics.h
then initialising graphics system using initgraph
and using the function rectangle(int left,int top,int
right,int bottom)
 
Is This Answer Correct ?    113 Yes 12 No
Sala
 
Answer
# 6
/* simple.c
example 1.0
*/
#include<graphics.h>
#include<conio.h>

void main()
{
int gd=DETECT, gm;

initgraph(&gd, &gm, "c:\\turboc3\\bgi " );
rectangle(200,50,350,150);

getch();
closegraph();
}
 
Is This Answer Correct ?    103 Yes 13 No
Raj
 
Answer
# 7
using rectangle(int right,int top,int left,int bottom) in
graphics.h
 
Is This Answer Correct ?    82 Yes 21 No
Suganya
 
Answer
# 8
/* simple.c
example 1.0
*/
#include<graphics.h>
#include<conio.h>

void main()
{
int gd=DETECT, gm;

initgraph(&gd, &gm, "c:\\turboc3\\bgi " );
rectangle(200,50,350,150);

getch();
closegraph();
}
 
Is This Answer Correct ?    66 Yes 10 No
Mahendra Microsoft
 
Answer
# 9
BY using #include<graphics.h>
we can draw rectangle.
The syntax is rectangle(int ,int ,int ,int)
{left,top,right,bottom}
 
Is This Answer Correct ?    55 Yes 7 No
Venkat
 
Answer
# 10
first include the graphics.h file
thus you can use the rectangle funtion give the proper
parameters and the wor is done
 
Is This Answer Correct ?    55 Yes 17 No
Azad
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD Synergy 6
void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }   1
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error HCL 3
write a program to Insert in a sorted list Microsoft 4
What is the main difference between STRUCTURE and UNION? HCL 11
main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }   1
main() { show(); } void show() { printf("I'm the greatest"); }   2
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }   6
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print   2
Printf can be implemented by using __________ list.   3
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }   1
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcpy(a,b)); } a. “Hello” b. “Hello World” c. “HelloWorld” d. None of the above HCL 4
 
For more C Code Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright © 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com