Problem 59. C Program to accept a string and find the length of the string (Process II)
#include<stdio.h>
#include<conio.h>
main( )
{
char name[80];
int i;
clrscr( );
printf(“enter a string ;”);
for(i=0;i<80&&((name[i]=getchar( ))! =’n’);i++);
printf(“%d is the size of string”,i);
getch( );
}
C compiler: gcc 4.1.2
Back to main directory: Sample C Program | Software Practical | Solved C Assignment#include<stdio.h>
#include<conio.h>
main( )
{
char name[80];
int i;
clrscr( );
printf(“enter a string ;”);
for(i=0;i<80&&((name[i]=getchar( ))! =’n’);i++);
printf(“%d is the size of string”,i);
getch( );
}
C compiler: gcc 4.1.2