Nested Loop

Design 1: ############### #include<conio.h>#include<stdio.h>void main(){clrscr();int i,j;for(i=1;i<=5;i++){for(j=1;j<=i;j++){printf(“#”);}printf(“n”);}getch();} Design 3: 100111000011111...

For Loop

Print “I love dogs” n times. #include<conio.h>#include<stdio.h>void main(){clrscr();int i,n;scanf(“%d”,&n);for(i=1;i<=n;i++){printf(“I love dogsn”);}getch();} Print even numbers from 1 to n....

Simple Interest

Suppose P is the initial amount (which is lent, deposited, invested or principal), t is the time or tenure & r is rate of interest, then Simple Interest (SI) can be calculated as below: From the above formula, Principal (P), Rate (r) & Time (t) can be...

While / Do While Loop

While Loop Main concept while(condition){statement;} Do While Loop Main concept do{statement;}while(condition); AS LONG AS THE CONDITION IS VALID, THE STATEMENT, INSIDE THE WHILE (OR DO WHILE) LOOP, WILL KEEP ON RUNNING, NO MATTER WHAT THE STATEMENT IS Print even...

If Else

 Expression Meaning a==b a is equal to b a!=b a is not equal to b a<=b a is less than equal to b a>=b a is greater than equal to b a<b a is less than b a>b a is greater than b a%b remainder of a÷b a/b quotient of a÷b || or && and Print wheather a...