Solution:
Program: #include<stdio.h> #include<graphics.h> #include<conio.h> #include<stdlib.h> int main() { int gd,gm,n,*x,i,k=0; //window coordinates int wx1=220,wy1=140,wx2=420,wy2=140,wx3=420,wy3=340,wx4=220,wy4=340; int w[]={220,140,420,140,420,340,220,340,220,140};//array for drawing window detectgraph(&gd,&gm); initgraph(&gd,&gm,"c:\\turboc3\\bgi"); //initializing graphics printf("Window:"); setcolor(RED); //red colored window drawpoly(5,w); //window drawn printf("Enter the no. of vertices of polygon: "); scanf("%d",&n); x = malloc(n*2+1); printf("Enter the coordinates of points:\n"); k=0; for(i=0;i<n*2;i+=2) //reading vertices of polygon { printf("(x%d,y%d): ",k,k); scanf("%d,%d",&x[i],&x[i+1]); k++; } x[n*2]=x[0]; //assigning the coordinates of first vertex to last additional vertex for drawpoly method. x[n*2+1]=x[1]; setcolor(WHITE); drawpoly(n+1,x); printf("\nPress a button to clip a polygon.."); getch(); setcolor(RED); drawpoly(5,w); setfillstyle(SOLID_FILL,BLACK); floodfill(2,2,RED); gotoxy(1,1); //bringing cursor at starting position printf("\nThis is the clipped polygon.."); getch(); cleardevice(); closegraph(); return 0; }CS101 Assignment 1 Solution and Discussion Fall 2020

Re: CS101 Assignment 1 Solution and Discussion
Introduction to Computing (CS101)
Assignment # 01
Fall 2020
Total marks = 20
30 November 2020
Please carefully read the following instructions before attempting assignment.
RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
The assignment is submitted after the due date. The submitted assignment does not open or file is corrupt. Strict action will be taken if submitted solution is copied from any other student or from the internet.
You should consult the recommended books to clarify your concepts as handouts are not sufficient.
You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.
Objectives:
· To understand the practical implementation of Number System.
· To understand the basic concept of Boolean Logical Operations and how to use it to solve a problem.
NOTE
No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.
If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.
For any query, feel free to email at:
Questions No 01 Marks (10)
Convert the following decimal numbers into equivalent binary numbers and then convert the binary answer back into equivalent decimal. Show all the steps of conversions.
4789 8735
Questions No 02 Marks (10)
Solve the given Boolean Expression by using truth table.
A
B
C
D

@zareen said in CS101 Assignment 1 Solution and Discussion Fall 2020:
decimal numbers into equivalent binary numbers and then convert the binary
