Muchas gracias ahora ya comprendi mejor para que sirve cada función
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú#include <iostream>
#include <stdio.h>
#include <gmp.h>
#define MAX 40
using namespace std;
int main()
{
mpz_t numero;
mpz_init(numero);
return 0;
}
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#define MAX 40
using namespace std;
void escribirNumero(long long int numero,FILE *fd);
int main()
{
long long int numero;
FILE *fd;
int digito,x;
if((fd = fopen("Practica1.txt","w"))!= NULL)
{
cout << "Dame el numero: " << endl;
cin >> numero;
cout << "Que digito desea buscar? " << endl;
cin >> digito;
escribirNumero(numero,fd);
}
else
printf("No se pudo crear archivo\n");
return 0;
}
void escribirNumero(long long int numero,FILE *fd)
{
long long int cociente,residuo;
for(cociente = numero;cociente != 0;cociente = cociente/10)
{
residuo = cociente % 10;
fwrite(&residuo,12,1,fd);
}
}