0% found this document useful (0 votes)
47 views1 page

Algorithm

The algorithm reads data from an input file, processes the characters, and writes output to a file. It uses a while loop to read each character until reaching the end character. If the character is H, it gets the start address and length of input data. If T, it stores string data at three addresses in the output file. Otherwise, it writes the input data to three consecutive addresses in the output file. It increments the address by three and repeats the process for each new input string.

Uploaded by

Hema Vathy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views1 page

Algorithm

The algorithm reads data from an input file, processes the characters, and writes output to a file. It uses a while loop to read each character until reaching the end character. If the character is H, it gets the start address and length of input data. If T, it stores string data at three addresses in the output file. Otherwise, it writes the input data to three consecutive addresses in the output file. It increments the address by three and repeats the process for each new input string.

Uploaded by

Hema Vathy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

ALGORITHM FOR ABSOLUTE LOADER 1. Start the program 2. Assign the required variable 3. Open the files fp1=fopen("input2.

dat","r"); fp2=fopen("out2.dat","w"); 4. Read the content. Using while loop perform the loop until character is not equal to E. 5. Then compare whether the character is equal to H 6. If H then get the starting address, length and input 7. Else if the character is T then store the string as the three address in the output file with input[0],inuput[1] for address input[2],inuput[3] for address+1 input[4],inuput[5] for address+2 8. Else if it is not H or T then perform the following fprintf in fp2 for output file for , input[0],inuput[1] for address input[2],inuput[3] for address+1 input[4],inuput[5] for address+2 9. Increment the address value by 3. 10. Read the next input string and repeat from step 4. 11. Finally terminate the program

You might also like