Sunday, 21 January 2018

Program for Open


Program for Open
#include<stdio.h>
#include<conio.h>
main()
{
FILE*fp1;
char ch;
int noc,nol,not,nos;
nol=noc=not=nos=0;
clrscr();
fp1=fopen("sunil.c","r");
if(fp1==NULL)
{
printf("file not found....");
}
else
{
while(!feof(fp1));
{
ch=fgetch(fp1);
if(ch==32)
{
nos++;
}
if(ch=='\t')
{
not++;
}
noc++;
}
}
printf("no of charters====>%d\n",noc);
printf("no of lines =======>%d\n",nol);
printf("no of tabs==========>%d\n",not);
printf("no of spaces========>%d\n",nos);
getch();
fcloseall();
}�

Related Posts:

  • Arrays With In The StructuresArrays With In The Structures C permits the use of arrays as structure members.we can use single or multidimensional arrays of type int or float.Ex:   struct marks      {      &nbs… Read More
  • Two Dimensional Array Of CharactersTwo Dimensional Array Of CharactersOur example program asks you to type your name.When you do so,it checks against a master list to see if you are worthy of entry to the palace.Example:    #include "string.h"&n… Read More
  • Introduction To StructuresIntroduction To StructuresArrays can be used to represent a group of data items that belong to same type,such as int or float.However, If we want to represent a collection of data items of different types using a single name,… Read More
  • Pointers And StringsPointers And Strings    We cannot assign a string to another,whereas we can assigna char pointer to another char pointer. This is shown with an example:main(){ char str1[]="hello"; char str2[10]; char… Read More
  • Structures and FunctionsStructures and FunctionsThe main philosophy of C language is the use of functions.C supports the passing of structure values as arguments to function. In this ,the values of a structure can be transferred from one function to… Read More

0 comments:

Post a Comment