Below is a sketchy outline of a C program

#include<stdio,h>
Main()
{
File *pt1, *pt2;
Int x;
Float y;
Char z;
Fpt=fopen(“sample,old”,”r”);
Fpt=fopen(“sample.new”,”w”);
……………………………………
Fclose (pt1);
Fclose (pt2);
}
Write C statements to do the following:
i. Read the values of x, y and z from the file sample.old [1 mark]
ii. Display each value on the screen and enter an updated value [2 marks]
iii. Write the new values to the data file sample.new [1 mark]
b)Correct the following code ,if necessary , to remove run time or compile time errors .Change the code as little as possible. If no change is needed ,just say so.
Void main(void)
{char x[3];
Strcpy(x,”dog”);
[ 2 marks]
c)Explain the difference between predefined functions and user defined functions [2 marks]
d)Suppose we have a user defined function, long square (long), which returns the square of a number, show how you would go about

For a custom-written paper on the above topic, place your order now!

What We Offer
• On-time delivery guarantee
• PhD-level professionals
• Automatic plagiarism check
• 100% money-back guarantee
• 100% Privacy and Confidentiality
• High Quality custom-written papers

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!