Program to accept a string and print by trailing spaces - 100 Most Important C# Programs

99. Program to accept a string and print by trailing spaces.

Code:

#include<conio.h>

#include<stdio.h>

main( )

{

char n,n1;

clrscr ( );

printf(“enter a string;”);

while((n=getchar( )!=’\n’)

if(n>=’a’ && n<=’z’)

putchar(n);

else

if(n>=’a’ && n<=’z’)

putchar(n);

getch( );

}