/* Write to text file */
#include<stdio.h>
int main()
{
FILE *fp;
char mystr[100];
fp=fopen("mytext.txt","w");
if(fp==NULL)
{
puts("Some error occured.");
return 1;
}
printf("\nEnter some lines:\n");
while(strlen(gets(mystr))>0)
{
fputs(mystr,fp);
fputs("\n",fp);
}
fclose(fp);
return 0;
}
A Tech publication for all. Get Knowledge about Web Development, Programming, and trending news, tutorials, and tools for beginners to experts.
Friday, September 23, 2016
Subscribe to:
Post Comments (Atom)
B
BEING CODERS
Take Your Coding Journey Further!
Find more coding tutorials, technology insights, programming guides, and practical knowledge. Choose your reading experience below!
✦ Keep Learning. Keep Building. Keep Coding. ✦
-
1 23 456 78910 #include<stdio.h> int main() { int i,j,k; k=1; for(i=1;i<5;i++) { for(j=1;j<=i;j++) { printf("%d",k++);...
-
Learn how to configure Let’s Encrypt SSL on Windows 11 using Win-ACME and IIS. Securing your website with HTTPS is no longer optional—it’s a...
-
1 10 101 1010 10101 #include<stdio.h> int main() { int i,j,k; for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { printf("%d",j%2)...
-
A fresh year brings fresh possibilities. ✨ New goals to work toward. New memories to make. New ideas waiting to take shape. But with so m...
-
World Country, State and City Database in SQL and JSON Format (Step-by-Step Guide) If you want to add all countries, states/provinces, and ...
-
5 45 345 2345 12345 CODE: #include <stdio.h> int main() { int i, j; for(i=5;i>=1;i--) { for(j=i;j<=5;j++) { printf("%d...
-
1234567 12345 123 1 int main() { int i,j; for(i=7;i>=1;i-=2) { for(j=1;j<=i;j++) { printf("%d",j); } printf("\n");...
-
Complete beginner-friendly guide to generate and install a free SSL certificate on Windows server If you’re running a website on Windows Se...
-
5 54 543 5432 54321 CODE : #include <stdio.h> int main() { int i, j; for(i=5;i>=1;i--) { for(j=5;j>=i;j--) { printf("%d...
-
India’s Own Marketplace for Small Online Jobs: Empowering Freelancers and Small Businesses In recent years, India has seen a huge shift in ...
No comments:
Post a Comment