Thursday, January 6, 2022

Factorial a Number Using Recursion in C++

Factorial a Number Using Recursion in C++

 A program that will demonstrate how to use recursion to solve the factorial value of the given number using C++ programming language.

I am currently accepting programming work, 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.





Program Listing

#include <iostream> int factorial(int n); int main() { int num_val=0; std::cout << "\n\n"; std::cout << "\tFactorial a Number Using Recursion in C++"; std::cout << "\n\n"; std::cout << "\tGive a Number : "; std::cin >> num_val; std::cout << "\n\n"; std::cout << "\tFactorial of " << num_val << " = " << factorial(num_val); std::cout << "\n\n"; std::cout << "\tEnd of Program"; std::cout << "\n\n"; return 0; } int factorial(int n) { if(n > 1) return n * factorial(n - 1); else return 1; }

Reverse a String in C#

Reverse a String in C#

A program that will ask the user to give a string and then the program will display the original string and reverse string output using C# programming language.

I am currently accepting programming work, 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.





Program Listing

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;


namespace Reverse_String

{


    

static class StringHelper

{

public static string ReverseString(string str)

{

char[] array = str.ToCharArray() ;

Array.Reverse(array) ;

return new string(array) ;

}

}



    class Program

    {


        

        static void Main(string[] args)

        {



            Console.Write("\n\n");

            Console.Write("Reverse a String in C#");

            Console.Write("\n\n");

            Console.Write("Give a String : ");

            string originalString = Console.ReadLine();


            Console.Write("\n\n");

            Console.Write("Original String     :  " + originalString);

            Console.Write("\n\n");

            Console.WriteLine("Reverse String  : " + StringHelper.ReverseString(originalString));

            Console.ReadLine();

        }

    }

}


Tuesday, January 4, 2022

Reverse An Array in C

Reverse An Array in C

 A  simple program to ask the user to give a series of numbers and then the program will reverse the arrangement of the given numbers using arrays in C programming language.

I am currently accepting programming work, 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.





Program Listing

#include <stdio.h> #define MAX 100 int main() { int arr[MAX],num=0,i=0,temp=0; printf("\n"); printf("\tReverse An Array in C"); printf("\n\n"); printf("\tEnter size of Array : "); scanf("%d",&num); printf("\n\n"); printf("\tEnter the elements :"); printf("\n\n"); printf("\t"); for(i=0;i<num;i++) { scanf("%d",&arr[i]); } for(i=0;i<num/2;i++) { temp=arr[i]; arr[i]=arr[num-i-1]; arr[num-i-1]=temp; } printf("\n\n"); printf("\tArray after reversing : \n"); printf("\t"); for(i=0;i<num;i++) { printf("%d ",arr[i]);; } printf("\n"); printf("\tEnd of Program"); printf("\n"); }

Monday, January 3, 2022

Bitwise Operators in C

Bitwise Operators in C

 A simple program that demonstrate how to use and declare bitwise operators in C programming language.

I am currently accepting programming work, 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.





Program Listing

/* bitwise.c

   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT

   Date     : November 19, 2018  Monday 2:38 PM

   Location : Bacolod City, Negros Occidental

   Website  : http://www.jakerpomperada.com

   Emails   : jakerpomperada@jakerpomperada.com

              jakerpomperada@gmail.com

              jakerpomperada@yahoo.com

              jakerpomperada@aol.com

*/


#include <stdio.h>


int main() 

 int x=0, y=0; 

 printf("\n\n");

 printf("\tBitwise Operators in C");

 printf("\n\n");

 printf("\tGive two integers: ");

 scanf("%d%d",&x,&y);

 printf("\n\n");

 printf("\t%d & %d =  %d\n",x,y,(x & y)); 

 printf("\t%d | %d = %d\n",x,y,(x | y)); 

 printf("\t%d ^ %d = %d\n",x,y,(x ^ y));

 printf("\t~%d = %d\n",x,~x); 

 printf("\t%d << %d = %d\n",x,2,(x << 2));

 printf("\t%d >> %d = %d\n",x,2,(x >> 2));

 printf("\n\n");

 printf("\tEnd of Program");

 printf("\n\n");

}


Sunday, January 2, 2022

Factorial a Number Using Recursion in C

Factorial a Number Using Recursion in C

 A factorial program that I wrote using C language that will ask the user to give a number and then it will compute the factorial value of the given number using recursion method.

I am currently accepting programming work, 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.





Program Listing

#include <stdio.h> int factorial_function(int num); int main() { int number_given=0; printf("\n"); printf("\tFactorial a Number Using Recursion in C"); printf("\n\n"); printf("\tGive a Number : "); scanf("%d",&number_given); int result = factorial_function(number_given); printf("\n"); printf("\tThe Factorial of %d = %d", number_given, result); printf("\n\n"); printf("\tEnd of Program"); printf("\n"); return 0; } int factorial_function(int num) { if(num ==0) return 1; else return (num*factorial_function(num-1)); }

Saturday, January 1, 2022

Print 1 To 15 in C++

Print 1 To 15 in C++

 A simple C++ program to display 1 to 15 series of numbers on the screen.

I am currently accepting programming work, 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.





Program Listing


#include <iostream>

#include <iomanip>


int main()

{

    std::cout <<"\n\n";

    std::cout << "\tPrint 1 To 15 in C++";

    std::cout <<"\n\n";

    for (int a=1; a<=15; a++) {

        std::cout << std::setw(4) << a

        <<std::setw(4);

    }

 std::cout <<"\n\n";

}



Friday, December 31, 2021

Input String in Python 2 in Linux

Input String in Python 2 in Linux

 A simple program in Python shows you have to accept string input from the user using Python 2.

I am currently accepting programming work, 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.






Program Listing

# input_string.py # Reverse a String in Python in Linux # Jake Rodriguez Pomperada, MAED-IT, MIT # www.jakerpomperada.com and www.jakerpomperada.blogspot.com # Globe Number : 09173084360 # Bacolod City, Negros Occidental Philippines. # Version of Python : Python 2.0 print("\n") print("\tInput String in Python 2 in Linux") print("\n") string_val = raw_input("\tGive Your Name : ") print("\n\n") print("\tHow are you {0}?".format(string_val)) print("\n") print("\tEnd of Program") print("\n")

Wednesday, December 29, 2021

Reverse a String in Python in Linux

Reverse a String in Python in Linux

 A program that will ask the user to give a string and then the program will display the original string and the reverse string using Python programming language.

I am currently accepting programming work, 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.







Program Listing

# reverse_string.py
# Reverse a String in Python in Linux
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# Globe Number : 09173084360
# Bacolod City, Negros Occidental Philippines.
# Version of Python : Python 2.0

def  reverse_string(x):
  return x[::-1]

print("\n")
print("\tReverse a String in Python in Linux")
print("\n")

string_val = raw_input("\tGive a String : ")
# In Python 3 use input instead of raw_input

# Reverse a String here

reverse_str = reverse_string(string_val)
  
# printing of results
print("\n")
print("\tOriginal String : {0} " .format(string_val))
print("\n")
print("\tReverse String  : {0} " .format(reverse_str))

print("\n")
print("\tEnd of Program")
print("\n")


Product of Two Numbers in Python in Linux

Product of Two Numbers in Python in Linux

 A simple program that will ask the user to give two numbers, and then the program will compute the product of the two given numbers using Python programming language in Linux operating system. I am using Linux Mint as my linux distribution in writing this program and sublime as my text editor.

I am currently accepting programming work, 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.


 

Program Listing

# product.py
# Produc of Two Numbers in Python in Linux
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# Globe Number : 09173084360
# Bacolod City, Negros Occidental Philippines.

print("\n")
print("\tProduct of Two Numbers in Python in Linux")
print("\n")
num1 = int(input("\tEnter First Number   : "))
num2 = int(input("\tEnter Second Number  : "))

# Multiply two numbers
product = (num1 * num2)

 
# printing values
print("\n")
print("\tThe Product of {0} and {1} is {2}." .format(num1,num2,product))

print("\n")
print("\tEnd of Program")
print("\n")

 

Tuesday, December 28, 2021

Leap Year in Python in Linux

 A program that I will ask the user to give a year and then the program will check if the given year is a leap year or not using Python programming language.

I am currently accepting programming work, 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.

 




 

Program Listing

# leap_year.py
# Leap Year in Python in Linux
# Jake Rodriguez Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# Globe Number : 09173084360
# Bacolod City, Negros Occidental Philippines.

print("\n")
print("\tLeap Year in Python in Linux")
print("\n")
year = int(input("\tEnter the Year : "))


# Checking if the given year if a Leap Year or Not

print("\n")

if (year%400 == 0):
          print("\tThe given year %d is a Leap Year." %year)
elif (year%100 == 0):
          print("\tThe given year %d is Not the Leap Year." %year)
elif (year%4 == 0):
          print("\tThe given year %d is a Leap Year." %year)
else:
          print("\tThe given year %d is Not the Leap Year." %year)

print("\n")
print("\tEnd of Program")
print("\n")