Thursday, August 13, 2020

Memory Allocation in C

 A program was written by my friend and fellow software engineer Thomas to demonstrate how to use memory allocation using C programming language. Thank you Tom for sharing your code to us.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


Program Listing

#define DEBUG

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

void* alloc_mem(size_t size, const char *file, unsigned line)
{
     assert(size > 0);
     assert(file != NULL);

     void* res = malloc(size);
     if (res == NULL)
         fprintf(stderr, "malloc failed at %s(%u)\n",file, line);
     else {
         fprintf(stderr, "alloc\t%u\t%u\t%s\t%u\n", (unsigned int)res,
size,file, line);
         memset(res, 0xCC, size);
     }

     return res;
}

void free_mem(void *p, const char *file, unsigned line)
{
     assert(p != NULL);
     fprintf(stderr, "free\t%u\t?\t%s\t%u\n", (unsigned int)p, file, line);
}

#ifdef DEBUG
#define malloc(size)    alloc_mem(size, __FILE__, __LINE__)
#define free(p)         free_mem(p, __FILE__, __LINE__);
#endif

int f()
{
     int *num = malloc(sizeof(int *));

     return *num;
}

int main()
{
     int *ip = malloc(sizeof(int *));
     if (ip != NULL)
     {
         *ip = 11;
         printf("*ip = %d\n", *ip);
     }
     printf("Num = %d\n", f());
     free(ip);
     //system("pause");
     return EXIT_SUCCESS;



Wednesday, August 12, 2020

Product of Two Numbers in Java

Product of Two Numbers in Java

 A simple program that I wrote using Java programming language that will ask the user to give two numbers and then the program will compute the product of two numbers and display the results on the screen.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

Sample Program Output



Program Listing

product.java

/* Product.java
 * Author : Jake Rodriguez Pomperada, MAED-IT, MIT
 * Email  : jakerpomperada@gmail.com
 * Place  : Bacolod City, Negros Occidental Philippines
 */

import java.util.Scanner;

public class Product {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
  
  System.out.println();
  System.out.println("\tProduct of Two Numbers in Java");
  System.out.println();
  System.out.print("\tGive First Number: ");
  int num1 = in.nextInt();
   
  System.out.print("\tGive Second Number: ");
  int num2 = in.nextInt();
   
  System.out.println();
  System.out.println("\t"+ num1 + " x " + num2 + " = " + num1 * num2);
  System.out.println();
  System.out.println("\tEnd of Program");
  System.out.println("\n\n");
}

}


Sunday, August 9, 2020

How To Run a PHP program in XAMPP?

Length of the String in C++

 I wrote this simple program to find the length of the string using C++ programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


Sample Program Output

Program Listing

// length.cpp
// Author : Jake Rodriguez Pomperada,MAED-IT,MIT
// Email  : jakerpomperada@gmail.com

#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    char str[] = "Information Technology";

    cout << "\n\n";
    cout << "\tLength of the String in C++";
    cout << "\n\n";
    cout << "\tThe Given String  : " << str <<"\n\n";
cout << "\tThe String Length = " << strlen(str);
cout << "\n\n";
cout << "\tEnd of Program ";
cout << "\n\n";
}


Months and it's Days in PHP

 I wrote this program to display the months and its corresponding days using PHP programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


Sample Program Output

Program Listing

<html> 
<head>
 <title>Months and it's Days in PHP </title>
</head>
<style>
 body {
font-family: arial;
size  : 12px;
 };
</style> 
<body>
<h2>Months and it's Days in PHP</h2>
<?php

$months=Array("January","February","March","April","May","June","July","August","September","October","November","December");

$count=1;
foreach($months as $current_month) {
print "$current_month has ".cal_days_in_month(CAL_GREGORIAN,$count,date("Y"))." days<Br>";
$count++;
}

?>
</body>
</html>





Hello World in PHP

Hello World in PHP

 A very simple hello world program that I wrote using PHP programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com

Program Listing

<html> 

<head>

 <title>Hello World in PHP </title>

</head>

<style>

 body {

font-family: arial;

size  : 12px;

color : red;

 };

</style> 

<body>

<?php

 echo "<h1>Hello World in PHP </h1>";

 ?>

</body>

</html>


Area of the Circle Using PHP

Tuesday, August 4, 2020

Linear Search in C Language

I wrote this program to ask the user to give a series of  numbers and then number to be search using linear search algorithm in C programming language.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com


Sample Program Output

Program Listing

#include <stdio.h>

int main()
{
  int array[100], search=0, c=0, n=0;

  printf("\n");
  printf("\tLinear Search in C Language");
  printf("\n\n");
  printf("\tEnter number of elements : ");
  scanf("%d", &n);

  printf("\tEnter %d integer(s)\n", n);

  for (c = 0; c < n; c++)
    scanf("%d", &array[c]);

  printf("\tEnter a number to search\n");
  scanf("%d", &search);

  for (c = 0; c < n; c++)
  {
    if (array[c] == search)
    {
      printf("%d is present at location %d.\n", search, c+1);
      break;
    }
  }
  if (c == n) {
    printf("%d isn't present in the array.\n", search);
  }
  printf("\n");
  printf("\tEnd of Program");
  printf("\n");
}



Monday, August 3, 2020

Odd and Even Numbers Checkers in VB.NET

Odd and Even Numbers Checkers in VB.NET

A simple program that I wrote to ask the user to give a number and then the program will check and determine whether the given number is an odd or even number using Microsoft Visual Basic.NET.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com





Sample Program Output



Program Listing

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim MyValue As Integer
        Dim isEven As Boolean
        MyValue = Val(TextBox1.Text)
        If MyValue Mod 2 = 0 Then
            isEven = True
            MsgBox("The number " & " " & MyValue & " is an EVEN number.")
        Else
            MsgBox("The number " & " " & MyValue & " " & "is an Odd number.")
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox1.Focus()
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        End
    End Sub
End Class

Sunday, August 2, 2020

Subtraction of Two Numbers in Golang

Subtraction of Two Numbers in Golang

I wrote this simple program using Go programming language to ask the user to give two numbers and then the program will compute the difference between of two numbers.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

// substract.go
// Author  : Jake Rodriguez Pomperada,MAED-IT,MIT
// Date    : August 2, 2020   10:20 AM
// Website : http://www.jakerpomperada.com
// Email   : jakerpomperada@gmail.com and jakerpomperada@yahoo.com

package main
 
import "fmt"
     
func main(){
     
    var n1 int 
    var n2 int 
        
    fmt.Print("\n\n")
    fmt.Print("\tSubtraction of Two Numbers in Golang")
    fmt.Print("\n\n")
    fmt.Print("\tEnter first number: ") 
    fmt.Scanln(&n1) // take input from user 
    fmt.Print("\tEnter Second number: ") 
    fmt.Scanln(&n2) // take input from user 
   
    solve := n1 - n2 
   
    fmt.Print("\n")
    fmt.Println("\tThe difference between",n1,"and",n2, "is",solve,".") 
    fmt.Print("\n")
    fmt.Print("\tEnd of Program")
    fmt.Print("\n")
}





Thursday, July 30, 2020

Today's Date in VB.NET

Today's Date in VB.NET

Today's Date in Visual Basic.NET

A very simple program that I wrote using Microsoft Visual Basic NET to display the current date.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim dt As Date = Today
        Label1.Text = "Today is " & dt
    End Sub
End Class





Wednesday, July 29, 2020

Product of Two Numbers in Visual Basic 6

Product of Two Numbers in Visual Basic 6

A simple program that I wrote to ask the user to give two numbers and then the program will compute the product of two numbers using Microsoft Visual Basic 6.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.My mobile number here in the Philippines is 09173084360. My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price. My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

Private Sub Command1_Click()
Dim a, b, product As Integer

a = Val(Form1.Text1(0).Text)
b = Val(Form1.Text1(1).Text)

product = (a * b)

MsgBox ("The product of " & a & " and " & b & " is " & product & ".")
End Sub

Private Sub Command2_Click()
Form1.Text1(0).Text = ""
Form1.Text1(1).Text = ""
Form1.Text1(0).SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub