Friday, 26 June 2020

Paragraph input using scanf

Q : Write a ‘C’ program in which a scanf() function can read a complete paragraph of text.

Answer : 



#include<stdio.h>
#include<conio.h>
/*============================
      Girfa Student Help
      Paragraph input using scanf
==============================*/
void main()
{
    
  char ar[100];
      clrscr();
      printf("Enter Paragraph>> ");
      scanf("%[^\n]",ar);
      printf("\n%s",ar);
      getch();
}


No comments:

Post a Comment