greatht
BAN USER
#include "stdio.h"
int main()
{
FILE *fp1 = fopen("test.txt", "r");
FILE *fp2 = fopen("test.txt", "r");
if (fp1 == NULL || fp2 == NULL) {
printf("error in opening the text file");
return 1;
}
const int LENGTH = 256;
char line[LENGTH];
int linecount = 0;
while (fgets(line, LENGTH, fp1) != NULL)
{
if (linecount < 10)
linecount = linecount + 1;
else {
fgets(line, LENGTH, fp2);
}
}
if (linecount < 10) {
printf("less than 10 lines in the file\n");
return 1;
}
while (fgets(line, LENGTH, fp2) != NULL)
{
printf("%s", line);
}
fclose(fp1);
fclose(fp2);
return 0;
}
I assume that each line has less than 256 characters, program needs modifications if the length is larger than 256
Repryandchinkle, Android Engineer at ABC TECH SUPPORT
I was born in Northridge USA, I like photography, I have wide photos collection of wildlife. I have many religious ...
Repmarktrejjo, Data Engineer at Accolite software
I’m Mark.I believe life is too short to be serious all the time, so if you cannot laugh ...
Repjesusitahyer, Data Engineer at ASAPInfosystemsPvtLtd
Hello Everyone, I am Jesusita and I am passionate about writing the stories about powerful mantra to get what you ...
RepNatalieLutz, Applications Developer at Absolute Softech Ltd
Pitch trending story topics and continually look for ways to push breaking and/or viral stories forward with new angles ...
Repreetaharriet, Applications Developer at Achieve Internet
As a sales clerk, I deal with customers on a daily basis. My work face-to-face assisting customers with finding the ...
Repcherylthurber, Developer Advocate at Absolute Softech Ltd
Hi,I am from Taxes, USA. Passionate multilingual translator with 2.5 years experience in Spanish-English translations.Looking to further ...
Reproseljannet75, Financial Software Developer at Abs india pvt. ltd.
Je suis jannet , une conseillère en voyages qui conseille les clients sur les options de voyage et les voyages organisés ...
Repbarrybzane, AT&T Customer service email at ASU
By Profession, I am a Child protective services social worker in Newark USA. My strong interest is in yoga. My ...
Repwaynebgrover, AT&T Customer service email at ASAPInfosystemsPvtLtd
I am 31 years old and live in San Jose with my family. I have all types of books and ...
Replouisefbray, Integration Software Engineer at Ask.com
Hey! My name is Louise and I am a computer hardware retailer and wholesaler.I also provide services online. My ...
RepPrankHwa, Animator at Accolite software
I am a Reporter and responsible for delivering updates and analysis on current events with the main goal to keep ...
RepDasiySmith, abc at 247quickbookshelp
I am versati;e architect, accomplished at designing commercial and residential structures of varying styles and purpose.I was met ...
Replorfalinda8, Travel Agent at Creative Wealth
Hello, I am Janice. I help people make travel arrangements, which include booking flights, hotels, sightseeing tours, and making dining ...
RepIvyWeir, HTML Freshers at Clean Power Research
Ivy , an Empathetic and passionate Psychology student with experience in performing psychological patient assessments, assisting in psychotherapy, monitoring patients' progress ...
RepTerryMorales, Accountant at ADP
I assist other social and human service providers in providing client services in a wide variety of fields, such as ...
RepRosieBell, Accountant at 8x8
I have technical knowledge of multiple camera technologies -Extensive communication, cooperation, and service skills -Critical thinking, analysis, free revenge spells ...
Repminniermontano, Android test engineer at 8x8
Hello my name is Minnie and i live in california. And I'm working as a paymaster at Tech Hifi ...
Repgoamgivheler, Accountant at Lava
I am working as a nurse in Bali Boer Cafarius. I enjoy relationships with patients and their families. It has ...
RepKimDavilla, Questions - Problem Solving Round at Cavium Networks
Kim , an associate veterinarian with 4+ years of experience. Specialist in companion animal emergency and also expert at Sudoku , playing ...
Repjosebowlin78, Aircraft engineer at CSK Auto
I am an Aircraft engineer . My role as an aircraft engineer involves the application of scientific and technological principles to ...
I don't think this algorithm is O(n)
- greatht November 20, 2007