Professor Porua https://www.professorporua.squaryum.com Squaryum's Educational Guide Wed, 05 Nov 2025 13:11:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.1 https://www.professorporua.squaryum.com/wp-content/uploads/2024/01/cropped-Logo-500-32x32.png Professor Porua https://www.professorporua.squaryum.com 32 32 ASCII https://www.professorporua.squaryum.com/number-system/ascii/ Sun, 09 Mar 2025 07:45:19 +0000 https://www.professorporua.squaryum.com/?p=513

American Standard Code for Information Interchange

7 bit code originated in 1960s to standardize data interchange between computers & teleprinters

ASCII

SYMBOL

32

space

48 to 57

0 to 9

65 to 90

A to Z

97 to 122

a to z

Example:

Suppose a binary number 10010111100100 needs to be transferred to its respective ASCII code.

Step 1: Break the binary number into sets of 7 bits from right to left. (1001011 | 1100100)
Step 2: Transfer each set to their respective decimal. (75 | 100)
Step 3: Transfer each set to their respective ASCII. (K | d)

So, 10010111100100 = Kd

]]>
File Size https://www.professorporua.squaryum.com/computer-basics/file-size/ Sun, 09 Mar 2025 07:04:54 +0000 https://www.professorporua.squaryum.com/?p=504

4 bits (b) = 1 nibble

8 bits (b) = 1 byte (B)

1024 bytes (B) = 1 kilobyte (KB)

1024 kilobyte (KB) = 1 megabyte (MB)

1024 megabyte (MB) = 1 gigabyte (GB)

1024 gigabyte (GB) = 1 terabyte (TB)

1024 terabyte (TB) = 1 petabyte (PB)

1024 petabyte (PB) = 1 exabyte (EB)

1024 exabyte (EB) = 1 zettabyte (ZB)

1024 zettabyte (ZB) = 1 yottabyte (YB)

]]>
Nested Loop https://www.professorporua.squaryum.com/c-programming/nested-loop/ Thu, 25 Jan 2024 12:20:31 +0000 https://www.professorporua.squaryum.com/?p=419

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:

1
00
111
0000
11111

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i,j,a;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
a=i%2;
printf(“%d”,a);
}
printf(“\n”);
}
getch();
}

Design 2:

*****
****
***
**
*

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i,j,a;
for(i=5;i>=1;i–)
{
for(j=1;j<=i;j++)
{
printf(“*”);
}
printf(“\n”);
}
getch();
}

Design 4:

1
10
101
1010
10101

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i,j,a;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
a=j%2;
printf(“%d”,a);
}
printf(“\n”);
}
getch();
}

]]>
For Loop https://www.professorporua.squaryum.com/c-programming/for-loop/ Thu, 25 Jan 2024 12:14:09 +0000 https://www.professorporua.squaryum.com/?p=414

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 dogs\n”);
}
getch();
}

Print even numbers from 1 to n.

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i,n;
scanf(“%d,&n);
for(i=2;i<=n;i=i+2)
{
printf(“%d\t”,i);
}
getch();
}

]]>
Simple Interest https://www.professorporua.squaryum.com/mathematics/simple-interest/ Thu, 25 Jan 2024 11:52:30 +0000 https://www.professorporua.squaryum.com/?p=406

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:

]]>
While / Do While Loop https://www.professorporua.squaryum.com/c-programming/while-loop/ Thu, 25 Jan 2024 11:38:24 +0000 https://www.professorporua.squaryum.com/?p=402

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 numbers from 1 to 100.

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a=2;
while(a<=100)
{
printf(“%d\t”,a);
a=a+2;
}
getch();
}

Print “THIS IS A TEXT” n times using do while.

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a=1,n;
scanf(“%d”,&n);
do
{
printf(“THIS IS A TEXT\n”);
}
while(a<=n);
getch();
}

\t IS USED FOR 1 TAB

\n IS USED FOR NEW LINE

]]>
If Else https://www.professorporua.squaryum.com/c-programming/if-else/ Thu, 25 Jan 2024 11:32:08 +0000 https://www.professorporua.squaryum.com/?p=398

 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 number is even or odd.

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a;
scanf(“%d”,&a);
if (a%2==0)
{
printf(“%d is even”,a);
}
else
{
printf(“%d is odd”,a);
}
getch();
}

Print the greatest number among 3 given numbers.

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a,b,c;
scanf(“%d %d %d”,&a,&b,&c);
if(a>b && a>c)
{
printf(“%d is the greatest”,a);
}
else if(b>a && b>c)
{
printf(“%d is the greatest”,b);
}
else if(c>a && c>b)
{
printf(“%d is the greatest”,c);
}
getch();
}

SCANF IS USED FOR USER INPUT

]]>
Pythagoras’ Theorem https://www.professorporua.squaryum.com/geometry/pythagoras-theorem/ Thu, 25 Jan 2024 11:15:37 +0000 https://www.professorporua.squaryum.com/?p=394

Pythagoras’ Theorem or Pythagorean Theorem is named after a Greek philosopher, Pythagoras, who was born around 507 BC in Samos island of old Greece.

According to the diagram:
∠ABC = 90° (AB is perpendicular to BC) & AC is Hypotenuse then:

(AC)² = (AB)² + (BC)²

OR

c² = a² + b²

OR

(Hypotenuse)² = (Perpendicular)² + (Base)²

]]>
BODMAS https://www.professorporua.squaryum.com/mathematics/bodmas/ Thu, 25 Jan 2024 11:03:43 +0000 https://www.professorporua.squaryum.com/?p=389

Step 1:

Look for brackets and complete the calculations inside them, according bracket order:
FIRST ( )   SECOND [ ]    THIRD { }

 

Step 2:

Look for any kind of roots (square roots, cube roots and others), indices (square of a number, cube of a number and others), exponents and powers.

 

Step 3:

Look for any kind of division and solve the calculations.

Step 4:

Look for any kind of multiplications and solve the calculations.

 

Step 5:

Look for any kind of additions and solve the calculations.

 

Step 6:

Look for any kind of subtractions and solve the calculations.

]]>
Introduction https://www.professorporua.squaryum.com/c-programming/introduction/ Thu, 25 Jan 2024 10:48:27 +0000 https://www.professorporua.squaryum.com/?p=381

Header Files

  • conio.h: CONsole Input Output (getch, clrscr)
  • stdio.h: STanDard Input Output (scanf, printf)
  • math.h: Mathematical functions (pow, sqrt, sin, cos, exp)
  • string.h: Character & string functions (char, strlen, String)

THERE ARE MANY OTHER HEADER FILES IN C
ALL ARE USABLE ACCORDING TO REQUIREMENTS

Print this line: “This is a test.”

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
printf(“This is a test.”);
getch();
}

Print the addition result of 3 & 5.

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a=3,b=5,c=0;
c=a+b;
printf(c);
getch();
}

PRINTF IS USED FOR SHOWING THE OUTPUT

]]>