Skip to main content

Drawing Different Shapes Program In C | BGI | VCMIT

Drawing Different Shapes Program In C



INPUT

#include<graphics.h>
#include<conio.h>
main()
{
   int gd = DETECT,gm,left=100,top=100,right=200,bottom=200,x= 300,y=150,radius=50;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   rectangle(left, top, right, bottom);
   circle(x, y, radius);
   bar(left + 300, top, right + 300, bottom);
   line(left - 10, top + 150, left + 410, top + 150);
   ellipse(x, y + 200, 0, 360, 100, 50);
   outtextxy(left + 100, top + 325, "My first C graphics program");

   getch();
   closegraph();
   return 0;
}

OUTPUT




Comments

Popular posts from this blog

Draw The Moving Car On The Screen Program In C | VCMIT

The Moving Car Program In C  INPUT #include <stdio.h> #include <graphics.h> #include <conio.h> #include <dos.h> int main() { int gd = DETECT, gm; int i, maxx, midy; initgraph(&gd, &gm, "C:\\TURBOC3\\BGI"); maxx = getmaxx(); midy = getmaxy()/2; for (i=0; i < maxx-150; i=i+5) { cleardevice(); setcolor(WHITE); line(0, midy + 37, maxx, midy + 37); setcolor(YELLOW); setfillstyle(SOLID_FILL, RED); line(i, midy + 23, i, midy); line(i, midy, 40 + i, midy - 20); line(40 + i, midy - 20, 80 + i, midy - 20); line(80 + i, midy - 20, 100 + i, midy); line(100 + i, midy, 120 + i, midy); line(120 + i, midy, 120 + i, midy + 23); line(0 + i, midy + 23, 18 + i, midy + 23); arc(30 + i, midy + 23, 0, 180, 12); line(42 + i, midy + 23, 78 + i, midy + 23); arc(90 + i, midy + 23, 0, 180, 12); line(102 + i, midy + 23, 120 + i, midy + 23); line(28 + i, midy, 43 + i, midy - 15); line(43 + i, midy - 15, 57 + i, midy - 15); line(57 + i, midy - 15, 57 + i, midy); line(57 +...

Perform 2D Rotation On A Given Object Program In C | VCMIT

2D Rotation On A Given Object Program INPUT #include<stdio.h> #include<graphics.h> void main() { int gd=DETECT,gm; initgraph(&gdriver,&gmode,"C//TurboC3//BGI"); int x1,y1,x2,y2 ; float b1,b2; float t,deg; printf(“Enter the coordinates of Line: ”); scanf(“%d%d%d%d”,&x1,&y1,&x2,&y2); setcolor(6); line(x1,y1,x2,y2); getch(); //cleardevice(); printf(“Enter the angle of rotation: “); scanf(“%f”,&deg); t=(22*deg)/(180*7); b1=abs((x2*cos(t))-(y2*sin(t))); b2=abs((x2*sin(t))+(y2*cos(t))); line(x1,y1,b1,b2); getch(); closegraph(); } OUTPUT

What is Software Engineering? | VCMIT

What is Software Engineering? Software engineering is defined as a process of analyzing user requirements and then designing, building, and testing software application which will satisfy those requirements. Let's look at the various definitions of software engineering: IEEE, in its standard 610.12-1990, defines software engineering as the application of a systematic, disciplined, which is a computable approach for the development, operation, and maintenance of software. Fritz Bauer defined it as 'the establishment and used standard engineering principles. It helps you to obtain, economically, software which is reliable and works efficiently on the real machines'. Boehm defines software engineering, which involves, 'the practical application of scientific knowledge to the creative design and building of computer programs. It also includes associated documentation needed for developing, operating, and maintaining them.'
// Assuming you have fetched the search query and blog posts // Function to calculate the similarity score between search query and post function calculateSimilarity(query, post) { // You can use a similarity algorithm here, like TF-IDF or cosine similarity // Return a score that represents how relevant the post is to the query } // Function to suggest relevant posts based on search query function suggestPosts(searchQuery, blogPosts) { const suggestedPosts = []; for (const post of blogPosts) { const similarityScore = calculateSimilarity(searchQuery, post); if (similarityScore > 0) { suggestedPosts.push({ post, similarityScore }); } } // Sort the suggested posts based on similarity score suggestedPosts.sort((a, b) => b.similarityScore - a.similarityScore); // Return the sorted list of suggested posts return suggestedPosts.map(item => item.post); } // Example usage const searchQuery = "your search query"; const allBlogPosts = [/* array of your blog posts */]; const suggestedPosts = suggestPosts(searchQuery, allBlogPosts); // Now you can display suggestedPosts to the user