I am Md. Anisur Rahman. I have completed Cyber Security for MSCSE at United International University in 2022.I have completed PGDIT from IIT, Jahangirnagar University in 2020. I'm a Head of IT at Programming24 School.
Function Main
Declare Real turns
Output "Input number"
Input turns
Output ToString(deg2rad(turns)) & " radians"
Output ToString(rad2deg(turns)) & " grades"
End
Function deg2rad (Real x)
Declare Real r
Assign r = x*pi/180
Return Real r
Function rad2deg (Integer x)
Declare Real r
Assign r = 180*x/pi
Return Real r
Declare integer variable m
Declare integer pointer variable ab
Assign 29 to m
Print the address of m and its value
Print the address of ab and the content it points to
Assign the address of m to ab
Print the address of ab and the content it points to
Assign 34 to m
Print the address of ab and the content it points to
Assign 7 to the content of ab
Print the value of m
#include <stdio.h>
int main()
{
//! showMemory()
int* ab;
int m;
m=29;
printf(" Address of m : %p\n",&m);
printf(" Value of m : %d\n\n",m);
ab=&m;
printf(" Address of pointer ab : %p\n",ab);
printf(" Content of pointer ab : %d\n\n",*ab);
m=34;
printf(" Address of pointer ab : %p\n",ab);
printf(" Content of pointer ab : %d\n\n",*ab);
*ab=7;
printf(" Value of m : %d\n\n",m);
return 0;
}
Address of m : 0x7ffeeed0d9ec
Value of m : 29
Address of pointer ab : 0x7ffeeed0d9ec
Content of pointer ab : 29
Address of pointer ab : 0x7ffeeed0d9ec
Content of pointer ab : 34
Value of m : 7
Function Main
Declare Integer k
Assign k = 1
If k=1
Output "t"
End
If k=0
Output "F"
Else
Output "!f"
End
For k = 0 to 3
Output ""&k
End
While k<5
Output ""&k
Assign k = k+1
End
Loop
Assign k = k+1
Output ""&k
Do k<7
End
Function Main
Declare Integer i, n
Assign n = 12
Declare Integer Array a[n]
Assign a[0] = 1
For i = 1 to n-1
Assign a[i] = a[i-1] * 2
End
For i = 0 to n-1
Output "a["&i&"] = " & a[i]
End
End
#include <stdio.h>
int main() {
//! showArray(a, cursors=[i,n], n=8, cw=32)
int i, n = 12;
int a[n];
a[0] = 1;
for (i = 1; i < n; i++) {
a[i] = a[i - 1] * 2;
}
for (i = 0; i < n; i++) {
printf("a[%i] = %i\n", i, a[i]);
}
}
Function Main
Declare Integer Array values[5]
Declare Integer i
Output "Enter 5 integers: "
For i = 0 to 4
Input values[i]
End
Output "Show the Array values: "
For i = 0 to 4
Output values[i]
End
End
Function Main
Declare Integer year
Output "Enter a year:"
Input year
If (year%100 == 0 && year%400 == 0) || (year%100 != 0 && year%4 == 0)
Output year & " is a leap year"
Else
Output year & " is a leap year"
End
End
Function Main
Declare Integer n, reversed, remainder, original
Assign reversed = 0
Output "Enter a number:"
Input n
Assign original = n
While n!=0
Assign remainder = n%10
Assign reversed = reversed * 10 + remainder
Assign n = n/10
End
If original == reversed
Output original& " is a palimdrome number"
Else
Output original& " is not a palimdrome number"
End
End
#include <stdio.h>
int main() {
int n, reversed = 0, remainder, original;
printf("Enter a number: ");
scanf("%d", &n);
original = n;
while (n != 0) {
remainder = n % 10;
reversed = reversed * 10 + remainder;
n /= 10;
}
if (original == reversed)
printf("%d is a palindrome.", original);
else
printf("%d is not a palindrome.", original);
return 0;
}
Function Main
Declare Integer n, reverse, remainder
Assign reverse = 0
Output "Enter a number:"
Input n
While n!=0
Assign remainder = n%10
Assign reverse = reverse * 10 + remainder
Assign n = n/10
End
Output "The reverse number =" & reverse
End
#include <stdio.h>
int main() {
int n, i;
printf("Enter a number: ");
scanf("%d", &n);
for (i = 1; i <= 10; ++i) {
printf("%d * %d = %d \n", n, i, n * i);
}
return 0;
}