All pastes #350761 Raw Edit

ZZ

public c v1 · immutable
·published 2007-02-11 18:13 UTC
rendered paste body
#include <stdio.h> #define Max 20void dupliqueMot (char* ,char* ,int);int main (void){	char tab_mot[Max], tab_taille[Max];	int longueur;	printf("Veuillez entrez votre mot : \n");    	fgets(tab_mot, Max, stdin);	printf("Veuillez entrez un entier inferieur a 20 pour dupliquer le mot : \n");	longueur=getchar();	dupliqueMot(tab_mot,tab_taille,longueur);	printf("Votre nouveau mot est : %s \n", tab_taille);	return 0;}		void dupliqueMot (char tab_mot[],char tab_taille[], int longueur){	int i=0,j=0,k=0,l=0;	while (tab_mot[i] != '\0')	{		i++;	}	while (k<=(Max))	{		k=k+i;		j++;	}	printf("Vous pouvez recopier votre mot %d fois \n",j);	while (longueur != 0)	{		for(i=0;tab_mot[i] != '\0';i++)		{			tab_taille[l]=tab_mot[i];			l++;		}		longueur--;	}	return;}