answersLogoWhite

0

#include<sys/types.h>

#include<sys/stat.h>

#include<unistd.h>

#include<fcntl.h>

#include<stdio.h>

int main()

{

char str[100]="abc d e f gh";

int c=0;

int fd,n,i;

n=strlen(str);

fd=create("multiple.c",O_WRONLY);

write(fd,str,n);

close(fd);

printf("file created /n");

fd=open("multiple.c",O_RDONLY);

read(fd,str,n);

for(i=0;i<=n-1;i++)

{

if ( str[i] == ' ' )

c++;

}

printf("no of spaces =%d",c);

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

How do you write a c program that counts number of blanks in a text file using standard io?

int count_whitespace (FILE* input) { int c, count=0; while (( c = getc(input) ) != EOF ) if ((char) c==' ') ++count; return count; }


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


What is Kyle Blanks's number on the Oakland Athletics?

Kyle Blanks is number 88 on the Oakland Athletics.


How do you write a program using function that counts the number of vowels in a string in java language?

Use text-editor notepad++


The program will end when a 0 value is read This final value 0 will not participate in the required calculation?

Some people have realised that dividing by zero or 0 will not work. Any program which counts down from a large number to 0 wil stop the program.


What program can be written to count the number of alphanumerics in a string?

public int getStringLength(String val) { return val.length(); } There is an inbuilt functionality in strings that counts the number of alphabets in a string called length()


What is counts in wool?

You may be thinking of counts in yarn, where counts can indicate the number of twists per inch in the spin.


How many points is the long haul on reading counts?

The points for the Long Haul on Reading Counts may vary depending on the specific program or district settings. Generally, books like &quot;The Long Haul&quot; by Jeff Kinney can have points assigned based on factors like reading level and length. To find the exact number of points, it's best to check the Reading Counts database or consult your school's reading program guidelines.


How do you know if its a happy number?

It is not the number, it is how it is applied that counts


What is the answer of write a program which read no N and then generate 54321012345?

To generate the sequence &quot;54321012345&quot; based on an input number ( N ), you can write a simple program that first counts down from ( N ) to 0, then counts back up to ( N ). Here's a Python example: N = int(input(&quot;Enter a number: &quot;)) result = ''.join(str(i) for i in range(N, -1, -1)) + ''.join(str(i) for i in range(1, N + 1)) print(result) When you input ( N = 5 ), this program will output &quot;54321012345&quot;.


What word goes in the blanks the you gave the nurse a you credit card number?

the i____gave the nurse an i___credit card number


How many zeros would you expect to see when writing the standard notation for the number 9108?

When writing the number 9108 in standard notation, you would not expect to see any zeros, as it is a four-digit number that does not have any zeros in its representation. The digits in 9108 are 9, 1, 0, and 8, but only the digit '0' appears, which counts as one zero. Thus, you would see one zero in the standard notation of 9108.