the code for student
#include<stdio.h>
void main()
{
char string[50];
int i, count=0;
printf(" Enter any sting :");
gets(string);
for(i=0;string[i];i++)
if(string[i] == ' ' )
count++;
printf(" \n Total number of space is: %d",count);
}
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
ย
Write a c program to count total number of space
1. Problem Name:
1. Write C program to count total number of blank spaces in a string
2. Write C program to detect total number of space
3. Count total number of space in c program
2.
3.
4. Code part
#include<stdio.h>
void main()
{
char string[500]; It take a string with length is 500
int i, count=0; take I and count variable and make sure count is zero
printf(" Enter any sting :");
gets(string); Take the string
for(i=0;string[i];i++) i=0 and string[i] means that string part will be continues on i=0 value and i++ means
that I will be increase sequentially
if(string[i] == ' ' ) that means that the string[i] value is black or not. If the I value is blank then they
count value is rise one by one
count++;
printf(" n Total number of space is: %d",count);
}
5. If any quarry , feel free to contact with me
Rezaul Karim Refath
B.Sc In CSE
Daffodil International University
Email: Rezaul15-1871@diu.edu.bd