Programming in C

Write a C program to delete blank spaces from a line of sentences input by the user:
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
char sen[150],c;
int i=0;
clrscr();
printf("enter any sentence:");
gets(sen);
puts("the sentence without any blank space is" );
while((c=sen[i++])!='\0')
{
if (c!=32)
printf("%c",c);
}

}

4 comments:

  1. Dynamic allocation use gareko bhaye ali advanced dekhinthyo hola sayad

    ReplyDelete
  2. Ankura: Timi garera post garideu na ta...

    ReplyDelete
  3. Lau bhayo ta aba Bichara malai po phasayo Harey!!!!

    ReplyDelete
  4. Write a C program to find whether the given number is prime or composite...
    #include
    #include
    void main()
    {
    int no,i;
    clrscr();
    printf(" Enter the Number U want to check:");
    scanf("%d",&no);
    i=2;
    while(i<=no-1)
    {
    if(no%i==0)
    {
    printf(" %d is not Prime number",no );
    break;
    }
    i=i+1;
    }
    if(no==i)
    printf("%d is a prime Number",no);
    getch();
    }

    ReplyDelete

Feel free to contact the admin for any suggestions and help.