A set of instructions for a computer to follow is called a p


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.

Solution

#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();
}

 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 compu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site