xxxxxxxxxx
#include <conio.h>
#include <graphics.h>
#include <stdio.h>
void main()
{
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, "");
line(100, 100, 150, 50);
line(150, 50, 200, 100);
line(150, 50, 350, 50);
line(350, 50, 400, 100);
rectangle(100, 100, 200, 200);
rectangle(200, 100, 400, 200);
rectangle(130, 130, 170, 200);
rectangle(250, 120, 350, 180);
setfillstyle(2, 3);
floodfill(131, 131, WHITE);
floodfill(131, 131, WHITE);
setfillstyle(11, 7);
floodfill(101, 101, WHITE);
floodfill(150, 52, WHITE);
floodfill(163, 55, WHITE);
floodfill(251, 121, WHITE);
closegraph();
}
xxxxxxxxxx
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
{
printf("Hello World... from thread = %d\n",
omp_get_thread_num());
}
}
xxxxxxxxxx
#include<graphics.h>
#include<conio.h>
void main()
{
intgd=DETECT, gm, i, x, y;
initgraph(&gd, &gm, "C:\\TC\\BGI");
x=getmaxx()/3;
y=getmaxx()/3;
setbkcolor(WHITE);
setcolor(BLUE);
for(i=1;i<=8;i++)
{
setfillstyle(i,i);
delay(20);
circle(x, y, i*20);
floodfill(x-2+i*20,y,BLUE);
}
getch();
closegraph();
}
xxxxxxxxxx
#include<graphics.h>
#include<conio.h>
void main()
{
intgd=DETECT, gm, i, x, y;
initgraph(&gd, &gm, "C:\\TC\\BGI");
x=getmaxx()/3;
y=getmaxx()/3;
setbkcolor(WHITE);
setcolor(BLUE);
for(i=1;i<=8;i++)
{
setfillstyle(i,i);
delay(20);
circle(x, y, i*20);
floodfill(x-2+i*20,y,BLUE);
}
getch();
closegraph();
xxxxxxxxxx
#include <conio.h>
#include <graphics.h>
#include <stdio.h>
void main()
{
int gdriver = DETECT, gmode;
initgraph(&gdriver, &gmode, "");
line(100, 100, 150, 50);
line(150, 50, 200, 100);
line(150, 50, 350, 50);
line(350, 50, 400, 100);
rectangle(100, 100, 200, 200);
rectangle(200, 100, 400, 200);
rectangle(130, 130, 170, 200);
rectangle(250, 120, 350, 180);
setfillstyle(2, 3);
floodfill(131, 131, WHITE);
floodfill(131, 131, WHITE);
setfillstyle(11, 7);
floodfill(101, 101, WHITE);
floodfill(150, 52, WHITE);
floodfill(163, 55, WHITE);
floodfill(251, 121, WHITE);
closegraph();
}
xxxxxxxxxx
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <graphics.h>
int main()
{
int x,y,r,midx, midy,color:
float t:
int gdriver=DETECT, gmode:
initgraph(&gdriver, &gmode, "CENNTUNNBGI");
midx=getmaxx()/2;
midy-getmaxy()/2;
r=10;
color=12;
setcolor (12);
setfillstyle (1,12);
settextstyle(0,0,3);
do
{
outtextxy(midx-220,35, "I LOVE PROGRAMMING"); outtextxy(midx-175, midy+180, "ROHIT TECH STUDY");
for(t=0;t<(2*M_PI);t+=0.01)
{
x=(r*16*sin(t)*sin(t)*sin(t))+midx
y=(r*(1-2)*(13*cos(t)-5*cos(2 t)-2*cos(3*t)-cos(4xt)))+(midy-30); pieslice(x,y,0,360,5);
pieslice(x,y,0,360,5);
}
floodfill(midx, midy,color); color=random(15)+1; setcolor (color); setfillstyle(1,color);
while (!kbhit());
getch();
closegraph();
return 0;
}
xxxxxxxxxx
#include <stdio.h>
#include <mpi.h>
using namespace std;
int main( int argc, char ** argv)
{
int rank, size;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
char message[255];
char nadawanie[255];
if(rank==0)
{
cin>>nadawanie;
MPI_Send(&nadawanie, 255, MPI_CHAR, 1, 0, MPI_COMM_WORLD);
}
else if(rank == 1)
{
MPI_Recv(&message, 255, MPI_CHAR, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD_ MPI_STATUS_IGNORE);
cout << message << endl;
}
}
xxxxxxxxxx
47961 19/1/2022 1400 634 4 4 346 0 1-2 2-1 13 9 10 7 3 3 2 -1 72 18 24 12
xxxxxxxxxx
#include<stdio.h>
int main()
{
int p,i,j,n,c=0;
float d[20],b[20],a[20][20],e[20][20],output;
printf("\n Enter the DIMENSION of the MATRIX A : ");
scanf("%d",&n);
printf("\n|----- NOTE : Enter the elements of matrix ROW-WISE* -----|\n");
printf("\nEnter elements of MATRIX A :\n");
for(p=0;p<n;p++)
{
for(i=0;i<n;i++)
{
scanf("%f",&a[p][i]);
}
}
printf("\nEnter elements of MATRIX B :\n");
for(p=0;p<n;p++)
{
scanf("%f",&b[p]);
}
for(j=0;j<n-1;j++)
{
if(a[j][j]==0)
{
printf("*This equation is NOT solvable by the Gaussian-elimination method...!* \n");
return 1;
}
for(p=j+1;p<n;p++)
{
e[p][j]=a[p][j]/a[j][j];
c++;
}
for(p=j+1;p<n;p++)
{
for(i=j+1;i<n;i++)
{
a[p][i]=a[p][i]-e[p][j]*a[j][i];
c++;
}
b[p]=b[p]-e[p][j]*b[j];
c++;
a[p][j]=0;
}
}
printf("\nAfter the conversion\n");
printf("\nMatrix A(%dx%d) and Matrix B(%dx1) will be : \n",n,n,n);
for(p=0;p<n;p++)
{
for(i=0;i<n;i++)
{
printf("%.4f ",a[p][i]);
}
printf("%.4f \n",b[p]);
}
printf("\n Output : ");
d[n-1]=b[n-1]/a[n-1][n-1];
c++;
for (p=n-2;p>=0;p--)
{
output = 0.0;
for(i=p+1;i<n;i++)
{
output=output+a[p][i]*d[i];
c++;
}
d[p]=(b[p]-output)/a[p][p];
c++;
}
for(p=0;p<n;p++)
{
printf("%.4f ",d[p]);
}
return 0;
}