« C » : différence entre les versions

De bricosoft
m Page créée avec « <div class="thumb tleft"><google uid="C08" position="left"></google></div> <div class="thumb tright">{{#widget:Twitter Search |query=#{{PAGENAME}} |title=Bricosoft.com/{{PAGE… »
 
m Nettoyage : gabarit 2012 (widgets Twitter/Google/DISQUS morts et fichiers fantômes)
Ligne 1 : Ligne 1 :
<div class="thumb tleft"><google uid="C08" position="left"></google></div>
<div class="thumb tright">{{#widget:Twitter Search |query=#{{PAGENAME}} |title=Bricosoft.com/{{PAGENAME}} |caption=Ce que les gens disent sur {{PAGENAME}} }} </div>
<div class="thumb tright">{{#widget:Twitter|user={{PAGENAME}}|count=8}}</div>
[[file:{{PAGENAME}}.png|thumb]]
[[file:{{PAGENAME}}.jpg|thumb]]
[[file:{{PAGENAME}}.gif|thumb]]
[[file:{{PAGENAME}}.svg|thumb]]
Le '''C''' est un langage de programmation impératif.
Le '''C''' est un langage de programmation impératif.


Ligne 63 : Ligne 56 :
*http://{{PAGENAME}}.biz
*http://{{PAGENAME}}.biz
*http://{{PAGENAME}}.fr
*http://{{PAGENAME}}.fr
{{#widget:DISQUS
|id=bricosoft
|uniqid={{PAGENAME}}
|url={{fullurl:{{PAGENAME}}}}
|url={{fullurl:{{PAGENAME}}}}
}}
}}


[[catégorie:new]]
[[catégorie:new]]

Version du 3 novembre 2026 à 19:23

Le C est un langage de programmation impératif.

Codes sources en vrac

Produit de deux matrices

#include <stdio.h>

#define N 10

void produit(float a[N][N], float b[N][N], float c[N][N], int nla, int nca, int nlb, int ncb) {
	int i, j, k;

	for (i = 0; i < ncb ; i++)
		for (j = 0; j < nla ; j++) {
			c[j][i] = 0;
			for (k = 0; k < nca; k++)
				c[j][i] = a[j][k] * b[k][i] + c[j][i];
		}
}

void affiche_matrice(float d[N][N], int nld, int ncd);

int main (void)
{
	float a[N][N] = { { 1 , 2 , 0, 4 } , { 3 , 1 , 2, 1 } };
	float b[N][N] = { { 1, 2, 1 }, { 3, 0, 2 }, { 1, 2, 0 }, { 1, 4, 1 } };
	float c[N][N];

	produit( a, b, c, 2, 4, 4, 3 );

	affiche_matrice(a, 2, 4);

	affiche_matrice(b, 4, 3);

	affiche_matrice(c, 2, 3);
}

void affiche_matrice(float d[N][N], int nld, int ncd) {
	int i, j;

	for ( i=0; i<nld; i++) {
		printf ("|");
		for (j=0; j<ncd; j++)
 			printf (" %.0lf |", d[i][j]);
 		printf("\n");
	}
	printf("\n");
}

Liens

|url=http://www.bricosoft.com/C }}