Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- FILE *senars=NULL,*parells=NULL;
- int n;
- if((senars=fopen("senars.txt","w"))==NULL){
- printf("Error al abrir/crear el archivo\n");
- }else if ((parells=fopen("parells.txt","w"))==NULL){
- printf("Error al abrir/crear el archivo\n");
- } else {
- for (n=1; n<=100; n++){
- if (n%2==0){
- fprintf(parells,"%d ", n);
- }
- else {
- fprintf(senars,"%d ",n);
- }
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement