Friday, August 9, 2019

Enum Statements in C

Here is a sample code that I wrote using the C programming language to show how to use enum statements.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

enum_example.c

#include <stdio.h>

int main()
{
enum MONTH {Jan=0,Feb,Mar};
enum MONTH month = Mar;
printf("\n\n");
     printf("\tEnum Program Demonstration");
     printf("\n\n");

  if (month == 0) {
printf("\tValue of January.");
} else if (month == 1) {
printf("\tMonth is February.");
}
if (month == 2) {
printf("\tMonth is March.");
}
printf("\n\n");
     printf("\tEnd of Program");
     printf("\n\n");
}




Logical Operators in C

In this article, I would like to share with you a sample program to demonstrate how to use logical operators in the C programming language. Logical operators are very important in making conditions in any C programs.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

logical_operators.c

/* logical.c
   Author   : Jake Rodriguez Pomperada,BSCS,MAED-IT
   Date     : November 19, 2018  Monday 2:18 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 a=10, b=4, c=10, d=20;
    // logical AND example
    printf("\n\n");
    printf("\tLogical Operators Demonstration");
    printf("\n\n");
     if (a>b && c==d) {
      printf("\n");
      printf("\tA is greater than B AND C is equal to D.\n");
    }
    else {
    printf("\n");
    printf("\tAND condition not satisfied.\n");
   }
     // logical OR example
    if (a>b || c==d) {
    printf("\n");
    printf("\tA is greater than B OR C is equal to D.\n");
       }
    else 
    {
     printf("\n");
     printf("\tNeither A is greater than B nor C is equal to D.\n");
    }
    // logical NOT example
    if (!a) {
    printf("\n");
        printf("\tA is zero.\n");
    }
    else {
    printf("\n");
    printf("\tA is not zero.");
 }
printf("\n\n");
    printf("\tEnd of Program");
    printf("\n\n");
}





Local Variable in C

In this article, I would like to share with you how to declare and use local variables in C programming language. The code is very simple to understand and use. I am using Dev C++ as my C compiler in this program.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output


Program Listing

local_variables.c


#include <stdio.h>

int main()

    {
     // Local variable declaration
    int a=0, b=0;
    int product=0;
     // actual variable initialization by assigning values.
     a = 5;
     b =  10;
     product = ( a * b);
     printf("\n\n");
     printf("\tLocal Variable Declaration Program");
     printf("\n\n");
     printf("\tThe product of %d and %d is %d.",a,b,product);
     printf("\n\n");
     printf("\tEnd of Program");
     printf("\n\n");
     return 0;
}

Basic String Input Program in Go


Write a program to print the following output.

Basic String Input Program in Go

What is your name?   : jacob samuel fuentebella pomperada [This line will be given by the user]

Hello JACOB SAMUEL FUENTEBELLA POMPERADA

How are you today?

End of Program

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com




Sample Program Output



Program Listing

/* string_exampple_one.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 4, 2019  Sunday  5:10 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"os"
"strings"
)

func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tBasic String Input Program in Go")
fmt.Print("\n\n")
fmt.Print("\tWhat is your name?   : ")
user_name, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

name_display := strings.ToUpper(user_name)

fmt.Printf("\tHello %s",name_display)
fmt.Print("\n")
fmt.Println("\tHow are you today?")
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}




Remove Consonants in a String in Go

Write a program that will ask the user to give a string and then the program will remove the consonants in the given string and display the results on the screen in Golang.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

/* remove_consonants.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 5, 2019  Monday 4:34 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"log"
"os"
"regexp"
"strings"
)


func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tRemove Consonants in a String")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
str, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

reg, err := regexp.Compile("[^aeiou]+")
if err != nil {
log.Fatal(err)
}
str_results := reg.ReplaceAllString(str, "")
display := strings.ToUpper(str_results)

fmt.Print("\tDISPLAY THE RESULTS")
fmt.Print("\n\n")
fmt.Printf("\tThe given String :  %s",str)
fmt.Print("\n")
fmt.Printf("\tThe string after consonants has been removed")
fmt.Print("\n\n")
fmt.Print("\t",display)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}








Count Number of Consonants in a String in Go

Write a program to ask the user to give a string and then the program will count the number of consonants in the given string and display the results on the screen in Golang.

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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com




Sample Program Output

Program Listing

/* consonants_count.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 5, 2019  Monday  5:54 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"os"
"regexp"
"strings"
)

func count_consonants(s string) map[string]int {
m     := make(map[string]int)
re, _ := regexp.Compile(`[bcdfghjklmnpqrstvwxyz]`)
res   := re.FindAllString(s, -1)
for _, v := range res {
m[v]++
}
return m
}

func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tCount Number of Consonants in a String")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
str, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

display :=  count_consonants(strings.ToLower(str))

fmt.Print("\tDisplay the Results")
fmt.Print("\n\n")
fmt.Print("\t",display)
fmt.Print("\n\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}









Upper Case of Strings in Golang


Write a program that will ask the user to give a string and then the program will convert the given string into upper case format in Golang 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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com



Sample Program Output


Program Listing

/* uppercase.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 5, 2019  Monday 4;05 PM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"os"
"strings"
)

func main() {

var str_given string

consoleReader := bufio.NewReader(os.Stdin)

fmt.Print("\n")
fmt.Print("\tUpper Case of Strings")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
str_given, _ = consoleReader.ReadString('\n')

display := strings.ToUpper(str_given)
fmt.Print("\n")
fmt.Print("\tDISPLAY THE RESULTS")
fmt.Print("\n\n")

fmt.Printf("\t%s",display)

fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}











Convert String to Lower Case Format in Go

Write a program that will convert the given string into lower case format see the output below using Go programming language.


Convert String to Lower Case Format

Give a String : LOGIC AND PROBLEM SOLVING

The result : logic and problem solving


End of Program


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.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Listing


Program Listing
\


/* string_lowercase.go
   Author   : Mr. Jake Rodriguez Pomperada, MAED-IT
   Date     : August 4, 2019  Sunday  6:11 AM
   Location : Bacolod City, Negros Occidental
   Website  : http://www.jakerpomperada.com
   Emails   : jakerpomperada@gmail.com and jake_pomperada@tup.edu.ph
 */


package main

import (
"bufio"
"fmt"
"os"
"strings"
)

func main() {
consoleReader := bufio.NewReader(os.Stdin)
fmt.Print("\n")
fmt.Print("\tConvert String to Lower Case Format")
fmt.Print("\n\n")
fmt.Print("\tGive a String : ")
str, _ := consoleReader.ReadString('\n')
fmt.Print("\n")

display := strings.ToLower(str)

fmt.Printf("\tThe result : %s",display)
fmt.Print("\n")
fmt.Print("\tEnd of Program")
fmt.Print("\n")
}