Click To Get Off-Campus Placement Jobs Info !!!
FREE!!! Latest Nagarro FULL Aptitude Mock Test for Practice
Practice 5+ Mettl Aptitude Mock Test

Program Discussion :: Basics

Home > Programs > Basics

3 / 248

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

Asked In :: IBM TCS Virtusa eLitmus

Post Your Answer Here:

Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here: