hi all,
i can't do the programme in c++ "Write a scanf function in c which accept sentence from user."pls any body reply.

thank you in advance

First, I assume that a sentence or a line will end when the user presses enter after input.

#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    char s[100];
	scanf("%[^\n]",&s);
	printf("%s",s);
	return 0;
}

The use of scanf here is very useful , \^n means exclude ^n character ( or new line ). Hence, scanf will read every character and stops when it sees new line character, which is equivalent to pressing enter.