Posts

Showing posts with the label While

In C, Prompt User And Draw Box By Given Characters, Height And Width

Image
#include<stdio.h> void main(){ int i, j, wd, hg; char hc, vc, ch; do{ fflush(stdin); printf("Enter horizontal & vertical character: "); scanf("%c %c", &hc, &vc); fflush(stdin); printf("Enter height & width: "); scanf("%d %d", &hg, &wd); printf("Using brutal force: \n"); for(i=wd;i;i--) printf("%c", hc); printf("\n"); for(i=hg-2;i;i--){ printf("%c",vc); for(j=wd-2;j;j--) printf(" "); printf("%c\n", vc); } for(i=wd;i;i--) printf("%c", hc); printf("\n"); fflush(stdin); printf("\nContinue [y/n]: "); scanf("%c", &ch); }while('y' == ch || 'Y' == ch); } Download

⚡ Cpp Program 🔥 Artist album tracks #tecqmate

Image
#include<iostream> #include<fstream> #include<string> #include<iomanip> using namespace std; int main(){ ifstream in("namedalbuminfo.txt"); if(!in){ cerr << "Failed to load input file!" << endl; return 1; } ofstream out("namedtracklist.txt"); string line; int hours, mins, sum_hrs = 0, sum_mins = 0, count = 0, diff; getline(in, line); out << "Album title: " << line << endl; getline(in, line); out << "Artist: " << line << endl; cout << "Welcome to 's tracklist generator!" << endl; out << "Tracks:" << endl; out << "--------------------------------------------------" << endl; while(!in.eof()){ count ++; getline(in, line); in >> hours >> mins; in.ignore(); out << setfill('0') << setw(2) << count; out << " - " <...

⚡ C Programming 🔥 Ninja's Shopping #tecqmate

Image
#include<stdio.h> void main(){ int shops; printf("How many shops will you be visiting? "); fflush(stdin); scanf("%d", &shops); int inds, shop; float cost, sum, min = 0.0f; for(int i = 1, j; shops >= i; i++){ printf("You are at shop #%d. How many ingredients do you need at shop #%d? ", i, i); scanf("%d", &inds); sum = 0.0f; for(j = 1; inds >= j; j ++){ printf("How much is ingredient #%d? ", j); scanf("%f", &cost); sum += cost; } if(1 == i || min > sum){ min = sum; shop = i; } printf("Your total at shop #%d is $%.2f.\n", i, sum); } printf("Your cheapest order was at shop #%d and cost $%.2f.\n", shop, min); }

⚡C Programming doubts ✔ While loop, do while loop, bit wise operators 🔥 Tecq Mate Tutorials ✌

Image

✔ Learn C in 2 hours ⚡ C Programming for beginners 🔥 Tecq Mate Tutorials ✌

Image

Java Swing JApplet - Loan EMI calculator

Image
Download code here .

Tecq Mate | Turbo C++ | While Loop vs Do While Loop | Loop step by step

Image

C plus plus read and write plain text into file

Image
Download code here .

Flowgorithm | Flow chart for loop output only 1 to 4

Image
Download solution here .

Flowgorithm | Flow chart while loop count 1 to 3

Image