Thursday, July 30, 2009

PLZ help me write this basic C++ instructions?

Write a statement, which will input several words followed by a return/enter key (new line character). Capture the input in the same variable declared above named 'sentence' and of length 60 (including null character)?





Please help! This program is for C++ and I use Dev-C++


I'll be so thankful to u guyz =)

PLZ help me write this basic C++ instructions?
we can use


char sentence[60];


cin%26gt;%26gt;sentence;





or


for(int i=0;i%26lt;59;i++)


cin%26gt;%26gt;sentence[i];


cin[i]='\0';


cout%26lt;%26lt;sentence%26lt;%26lt;"\n";
Reply:#include%26lt;stdio.h%26gt;


main()


{


int i;


char sentence[60];


scanf("%s", sentence);


printf("enter sentence");


}
Reply:char sentence[60];


scanf("%s", sentence);

gift baskets

No comments:

Post a Comment