Skip to main content

Posts

Printf within Printf

Hello friends today I am sharing new concept of printf within printf. In this concept one printf demonstrating an other printf. Rule : Inner printf returns Length of string printed on screen to the outer printf   Printf inside printf in C : Example #include<stdio.h> #include<conio.h> void main() { int num=1342; clrscr(); printf("%d",printf("%d",printf("%d",num))); getch(); }   Output : 134241 Know How ? Firstly Inner printf is executed which results in printing 1324  This Printf Returns total number of Digits i.e  4 and second inner printf will looks like printf("%d",printf("%d",4)); It prints 4 and Returns the total number of digits i.e 1 ( 4 is single digit number ) printf("%d",1); It prints simply 1 and output will looks like 132441

PIANO Programming in c

Piono program output click to see the coding of piano programming

How to Create own header file

Hello Friends this is Akshay and today i m sharing a new concept to create own header file in C like #include < stdio.h > so lets start to know how to create new header file... follow these steps...  Step1: Open turboc compiler and click to new.  Step2: Enter your own command lines as possibles and save it as your_name.h. Close turbo compiler. step3: And after saving goto in the turboc folder find bin folder and then your_name.h.  turboc > bin > your_name.h step4: Copy this file to include folder in turboc... turboc > include > your_name.h step5: Open tubroc compiler then use your own header file name.   happy coding...☺

Secret to learn programming easily

Hard problems become easier by working through them with diagrams, effort and patienceIn other words, don't just wait for answers to come to you--go out and find them. Don't just use what's in your head--use paper, or the computer, or a whiteboard, todraw out the ideas, try experiments, make the patternsvisiblerather than waiting for a flash of insight.I remember really learning this lesson during the first problem set--I'd started it when it was handed out, but the night before it was due I still had one problem left. I spent hours on that problem, but I spent it drawing out equations, working through possibilities. Each one ended in failure, until I had a flash of insight in the middle of writing out an equation. If I hadn't worked through (and discarded) all those possibilities, I'd have had no hope of solving that problem.So how do you apply this principle in practice?Program Program ProgramIf you're learning to program, you should be programming. Workp...

8 Common Programming Mistakes

8 Common Programming Mistakes Learning to program can be tough--just ask anyone who's done it! Fortunately, a lot of problems happen over and over again--I've put together 8 of the most common problems that you'll run into as a new programmer. 1. Undeclared Variables int main() { cin>>x; cout< >x; cout< >a; cin>>b; cout<<"The sum is: "< >b; cin>>a; sum=a+b; cout<<"The sum is: "< >x; "Why doesn't my loop ever end?" If you use a single equal sign to check equality, your program will instead assign the value on the right side of the expression to the variable on the left hand side, and the result of this statement is the value assigned. In this case, the value is 'Y', which is treated as true. Therefore, the loop will never end. Use == to check for equality; furthermore, to avoid accidental assignment, put variables on the right hand side of the expression and you'll get...

Moving car

// moving car animation #include #include void main() { int gd=DETECT,gm; int i ,j=0; initgraph(&gd,&gm,"akshay"); settextstyle(GOTHIC_FONT,HORIZ_DIR,4); getch(); i=0; while(i<=420) { rectangle(150+i,350,200+i,400); rectangle(50+i,275,150+i,400); circle(175+i,410,10); circle(75+i,410,10); setcolor(j++); delay(100); i=i+10; cleardevice(); } getch(); closegraph(); }