Question:Write a scanf function in c programming language which accept sentence from user
Answer
#include<stdio.h> #define MAX 500 int main(){ char arr[MAX]; printf("Enter any sentence which can include spaces.\n"); printf("To exit press enter key.\n"); scanf("%[^\n]s",arr); printf("You had entered: \n"); printf("%s",arr); return 0; }Sample output: Enter any sentence which can include spaces. To exit press enter key. May I help you? You had entered: May I help you?
+ Report
Write a scanf function in c programming language which accept sentence from user