create a num table in a new file in c

 


#include<stdio.h>

int main()

{

FILE *ptr;

int num;

printf("Enter the integer which table you need of\n");

scanf("%d",&num);

ptr = fopen("table.txt","w");


for(int i=0 ; i<10 ; i++){

fprintf(ptr,"%d*%d=%d\n",num,i+1,num*(i+1));

}


fclose(ptr);

  return 0;

Comments

Popular posts from this blog

write a programme to compare time stamp in c

write a struct programme to keep bank details in c