C++ Program to Interview Questions Using For Loop

Master C++ with Real-time Projects and Kickstart Your Career Start Now!!

Program 1

//Tricky Question of for loop
#include<iostream>
using namespace std;
int main()
{
      int i=10,j=10;
      system("cls");
      while(i-j)
      {
           cout<<"Data Flair";
      }
      cout<<"End";
    //   while(sizeof(NULL))
    //   {
    //       cout<<"\nData Flair";
    //          // continue;
    //            break;

    //   }

    //    for( ; sizeof(NULL) ; )
    //      {
    //         cout<<"DataFlair";
    //         break;
    //      }

    //   for( ;  ; )
    //   {
    //     cout<<i<<endl;
    //     if(i==10)
    //      break;
    //     i++;
    //   }

    //   for(i=1;i<=10;i++);
    //     cout<<i;
     return 0;
}

 

Did we exceed your expectations?
If Yes, share your valuable feedback on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *