First of all i want to show you the book by which iam now a pro in c++ .You can buy it by clicking here C++ book Loops Loops are used to repeat a block of code.This also helps you by saving your time ,reducing errors and making code readable.There are 3 loops in c++ . For loop A for loop enables a particular set of conditions to be executed repeatedly until a condition is satisfied Example # include <iostream> using namespace std; int main(){ int i=1; while(i<=6) { cout<<"Value of variable i is: "<<i<<endl; i--; } } While Loop In While loop we give a condition and the loop continues until the condition becomes false. Example int pro = 0; while ( pro < 5) { cout << pro << "\n"; pro++; } In the above example (i<5) is a condition and the loop will continue until it becomes false Do While loop This loop is also like while loop but it executes...
Loding Screen in qbasic- First open your qbasic ide then type following code. CLS LOCATE 20,35 #This function is used for location PRINT "LOADING" #this prints loading on a specific area LOCATE 22,10 #This will print the next value below loading COLOR 10 #colour LOCATE 22,10 PRINT "**" SLEEP 1 #This will make a delay of 1 second and then display next word this will make your screen look like loading screen. LOCATE 24,10 #locate the first value of coordinate according to which location you set before for e.x on first I printed 2 stars after giving coordinate of 24 so I had printed 24 in this location PRINT "**********" SLEEP 1 LOCATE 35,10 PRINT "****" Share this with your friends and follow us for more awesome projects.
Comments
Post a Comment