Access Millions of academic & study documents

Solutions exercices

Content type
User Generated
Showing Page:
1/10
Programation, correction des exercices de
laboratoires
1. Addition et multiplication de deux nombres complexes
#include <stdio.h>
main()
{
//introduction et mise en place de base
double a1 = 0, a2 = 0, b1 = 0, b2 = 0, x = 0, y = 0, x1 = 0, y1
= 0;
printf("\nAddition et multiplication de deux nombres
complexes\n\n");
printf("Veuillez rentrer les valeurs des deux nombres complexes
en 'a' et en 'b'\n\n");
printf("**Formule ==> Z=a+jb**\n\n");
printf("Premier nombre complexe :\n\n");
printf("a=?\n\n");
scanf("%lf",&a1);
printf("\n");
printf("b=?\n\n");
scanf("%lf",&b1);
printf("\n");
printf("**Formule ==> Z=a+jb**\n\n");
printf("Deuxieme nombre complexe :\n\n");
printf("a=?\n\n");
scanf("%lf",&a2);
printf("\n");
printf("b=?\n\n");
scanf("%lf",&b2);
printf("\n");
//mise en équations et opérations
x = a1+a2;
y = b1+b2;
if ((b2*b1)>0)
{ x1 = (a1*a2) - (b2*b1); }
else
{ x1 = (a1*a2) + (b2*b1); }
y1 = (a1*b2) + (b1*a2);
printf("L'addition vaut %f+j%f\n\n", x, y);
printf("La multiplication vaut %f+j%f\n\n", x1, y1);
}

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/10
2. Derivée de polynomes
#include <stdio.h>
main()
{
int a = 0, b = 0, c = 0, d =0, a1 = 0, b1 = 0, c1 = 0;
printf("\nDerivee de polynomes reels\n\n");
printf("Polynome du type ax^3 + bx^2 + cx + d\n\n");
printf("Entrez a\n");
scanf("%d",&a);
printf("\nEntrez b");
scanf("%d",&b);
printf("\nEntrez c");
scanf("%d",&c);
printf("\nEntrez d");
scanf("%d",&d);
printf("\n\n");
a1=3*a;
b1=2*b;
c1=c;
printf("Le polynome derive est %d x^2 + %d x + %d\n\n",a1,
b1,c1);
}
3. Diviseur de deux nombres
#include <stdio.h>
main()
{
int Nombre1 = 0, Nombre2 = 0, Permuteur = 0;
printf("\nEntrez un nombre entier\n\n");
scanf("%d", &Nombre1);
printf("Entrez un autre nombre entier\n\n");
scanf("%d",&Nombre2);
if (Nombre2 > Nombre1)
{
Permuteur = Nombre1;
Nombre1 = Nombre2;
Nombre2 = Permuteur;
}
if (Nombre1%Nombre2 == 0)
{
printf("Les nombres sont divisibles l'un par
l'autre\n\n");
}

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/10

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 10 pages?
Access Now
Unformatted Attachment Preview
Programation, correction des exercices de laboratoires 1. Addition et multiplication de deux nombres complexes #include main() { //introduction et mise en place de base double a1 = 0, a2 = 0, b1 = 0, b2 = 0, x = 0, y = 0, x1 = 0, y1 = 0; printf("\nAddition et multiplication de deux nombres complexes\n\n"); printf("Veuillez rentrer les valeurs des deux nombres complexes en 'a' et en 'b'\n\n"); printf("**Formule ==> Z=a+jb**\n\n"); printf("Premier nombre complexe :\n\n"); printf("a=?\n\n"); scanf("%lf",&a1); printf("\n"); printf("b=?\n\n"); scanf("%lf",&b1); printf("\n"); printf("**Formule ==> Z=a+jb**\n\n"); printf("Deuxieme nombre complexe :\n\n"); printf("a=?\n\n"); scanf("%lf",&a2); printf("\n"); printf("b=?\n\n"); scanf("%lf",&b2); printf("\n"); //mise en équations et opérations x = a1+a2; y = b1+b2; if ((b2*b1)>0) { x1 = (a1*a2) - (b2*b1); } else { x1 = (a1*a2) + (b2*b1); } y1 = (a1*b2) + (b1*a2); printf("L'addition vaut %f+j%f\n\n", x, y); printf("La multiplication vaut %f+j%f\n\n", x1, y1); } 2. Derivée de polynomes #include main() { int a = 0, b = 0, c = 0, d =0, a1 = 0, b1 = 0, c1 = 0; printf("\nDerivee de polynomes reels\n\n"); printf("Polynome du type ax^3 + bx^2 + cx + d\n\n"); printf("Entrez a\n"); scanf("%d",&a); printf("\nEntrez b"); scanf("%d",&b); printf("\nEntrez c"); scanf("%d",&c); printf("\nEntrez d"); scanf("%d",&d); printf("\n\n"); a1=3*a; b1=2*b; c1=c; printf("Le polynome derive est %d x^2 + %d x + %d\n\n",a1, b1,c1); } 3. Div ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4