A set of instructions for a computer to follow is called a program. The collecti
ID: 3936406 • Letter: A
Question
A set of instructions for a computer to follow is called a program. The collection of programs used by a computer is referred to as the software for that computer. The actual physical machines that make up a computer installation are referred to as hardware. As we will see, the hardware for a computer is conceptually very simple. However, computers now come with a large array of software to aid in the task of programming. This software includes editors, translators, and managers of various sorts. The resulting environment is a complicated and powerful system. In this book we are concerned almost exclusively with software, but a brief overview of how the hardware is organized will be useful.
Explanation / Answer
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *p;
char ch;
int w=1;
clrscr();
p=fopen("sample","r");
if(p==NULL)
{
printf("file not found");
}
else
{
ch=fgetc(p);
while(ch!=EOF)
{
printf("%c",ch);
if(ch==' '||ch==' ')
{
ch=fgetc(p);
if(ch=='a' || ch=='A' )
w++;
}
ch=fgetc(p);
}
printf(" Words in a file are=%d",w);
}
fclose(p);
getch();
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.