FrozenFlame
Flag: India
Registered: May 22, 2022
Last post: November 15, 2024 at 9:48 PM
Posts: 166
1 2 3 4

Ikr? But I have to do it for the university assignments :โ ^โ )

posted about 2 years ago

#include <stdio.h>
#include <conio.h>
#include <math.h>
#define MAX 20
void init(int p[]);
void read(int p1[],int p2[]);
void print(int p[]);
void add(int p1[],int p2[],int p3[]);
void sub(int p1[],int p2[],int p3[]);
void multiply(int p1[],int p2[],int p3[]);
void main()
{
int p1[MAX],p2[MAX],p3[MAX];
int choice;
do
{
printf("\n 1. Creation of polynomials ");
printf("\n 2. Addition of polynomials ");
printf("\n 3. Substraction of polynomials ");
printf("\n 4. Multiplication of polynomials ");
printf("\n 5. EXIT ");
printf("\n 1. Please enter your choice ");
scanf("%d",&choice);
switch(choice)
{
case 1 : read(p1,p2);
break;
case 2 : add(p1,p2,p3);
printf("\n 1st Polynomial ");
print(p1);
printf("\n 2nd Polynomial ");
print(p2);
printf("\n Sum of given polynomials : ");
print(p3);
break;
case 3 : sub(p1,p2,p3);
printf("\n 1st Polynomial ");
print(p1);
printf("\n 2nd Polynomial ");
print(p2);
printf("\n Substraction of given polynomials : ");
print(p3);
break;
case 4 : multiply(p1,p2,p3);
printf("\n 1st Polynomial ");
print(p1);
printf("\n 2nd Polynomial ");
print(p2);
printf("\n Multiplication of given polynomials : ");
print(p3);
break;
}
}
while(choice!=5);
}
void read(int p1[],int p2[])
{
int n,i,power1,coeff1,power2,coeff2;
init(p1);
printf("\n Enter number of terms : ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\n Enter the First term (power,coefficient) ");
scanf("%d%d",&power1,&coeff1);
p1[power1]=coeff1;
}
init(p2);
printf("\n Enter number of terms : ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("\n Enter the Second term (power,coefficient) ");
scanf("%d%d",&power2,&coeff2);
p2[power2]=coeff2;
}

}
void init(int p[])
{
int i;
for(i=0;i<MAX;i++)
p[i]=0;
}
void add(int p1[],int p2[],int p3[])
{
int i;
for(i=0;i<MAX;i++)
p3[i]=p1[i] + p2[i];
}
void sub(int p1[],int p2[],int p3[])
{
int i;
for(i=0;i<MAX;i++)
p3[i]=p1[i] - p2[i];
}
void multiply(int p1[],int p2[],int p3[])
{
int i,j,k;
for( i=0; i<=MAX; i++)
for( j=0; j<=MAX; j++)
k=i+j;
p3[k] = p3[k]+p1[i]*p2[j];
}
void print(int p[])
{
int i;
for(i=0;i<MAX;i++)
if(p[i]!=0)
printf("%dX^%d ",p[i],i);
}

posted about 2 years ago

Addition and substraction of polynomials is working fine but the multiplication isn't

posted about 2 years ago

I feel for you man ๐Ÿ˜”

posted about 2 years ago

Lmao we are about to get banged๐Ÿ’€

posted about 2 years ago

God's squad vs boys out of Mumbai , either way india wins๐Ÿ—ฟ

posted about 2 years ago

When is it coming back?

posted about 2 years ago

Aspas

posted about 2 years ago

Viper mini

posted about 2 years ago

This is either a hit or a miss with Cned.W nonetheless!

posted about 2 years ago

Title ^

posted about 2 years ago

Pet wussy

posted about 2 years ago

It dropped to 1.8k on big billion days sale๐Ÿ’€

posted about 2 years ago

Let's go eggman!

posted about 2 years ago

Oswald is a safety-conscious but fun-loving octopus who lives in an apartment complex in Big City with his dog, Weenie. His neighborhood is peopled with colorful characters like his pal, Henry the Penguin, Madame Butterfly, who runs the Big Diner, and her daughter, Catrina Caterpillar. Oswald likes to play the piano and sing, and he always does whatever he can to help his friends and neighbors.

posted about 2 years ago

"Bigger the mass๐Ÿ‘ , bigger is the force of attraction"๐Ÿ˜ˆ๐Ÿ˜ˆ

posted about 2 years ago

Morning wood esports

posted about 2 years ago

The trash one ๐Ÿ’€

posted about 2 years ago

God damn it! They still have to keep those bots ๐Ÿ’€

posted about 2 years ago

They'll be announcing 3 more players right? since they are building a 10 man.

posted about 2 years ago

The team comp is a serious concern rn.

posted about 2 years ago

No Lmemore? fuck.

posted about 2 years ago

Agriculture a.k.a farming is the most important and favourite occupation of our region. Farmers harvest crops(baits) in off-season by sprinkling water (leaks) to attract customers(audience) for minimal costs(no contexts) and maximum returns(impressions).

posted about 2 years ago

argh

posted about 2 years ago

Amouranth?

posted about 2 years ago

Agriculture a.k.a farming is the most important and favourite occupation of our region. Farmers harvest crops(baits) in off-season by sprinkling water (leaks) to attract customers(audience) for minimal costs(no contexts) and maximum returns(impressions).

posted about 2 years ago

PRX

posted about 2 years ago

BLEED

posted about 2 years ago

tf is that!!?

posted about 2 years ago

Too many "pronouns" nowadays ๐Ÿ˜”

posted about 2 years ago

Can't wait to see him making his brain-dead plays on lan lmao

posted about 2 years ago

LFGGGGG

posted about 2 years ago

Thanks for the info folks!

posted about 2 years ago

Any dates?

posted about 2 years ago

Fnatic ezzzzzz win

posted about 2 years ago

NGL this orangutan roster has the potential to represent APAC globally.

posted about 2 years ago

PRX all the way baby

posted about 2 years ago

I like glitchpop.

posted about 2 years ago

888

posted about 2 years ago

is

posted about 2 years ago

I like the black variant of the sovereign ghost.

posted about 2 years ago

Bruv you can't even compare these two.SkRossi runs like a headless chicken and dies.He buys operator with no shields in eco rounds, NGL he's good in 1v1 fights but you really can't see him doing good in clutch situations.On the other hand Kang Kang overshadows him in any aspects possible.

posted about 2 years ago

Yay
Sugar zero
Stax
Jingg
Boaster

posted about 2 years ago

Bruv i opened like 20 accounts just to get a good vandal or phantom skin, all I got is smite or nebula skins and 1 ion operator,wtf!! What are the odds of getting a good night market??I am pissed

posted about 2 years ago

Inshallah boys played well

posted about 2 years ago

Ain't my name kinda cringe O_o

posted about 2 years ago

Sentinels

posted about 2 years ago
1 2 3 4