Program Discussion :: Basics
6 / 279
Write a program to print next to the last word of a sentence.
Answer:
#include
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
cin.ignore();
char str[100];
int l=0;
char nstr[100];
cin.getline(str,100);
for(int i=0;str[i]!='\0';i ){
l ;
}
int k=0,j=0;
for(int i=l;i>=0;i--){
if(j==1