A simple program that I wrote to solve the area of the circle using the C programming language.
Learn Computer Programming Free from our source codes in my website.
Sponsored Link Please Support
https://www.techseries.dev/a/27966/qWm8FwLb
https://www.techseries.dev/a/19181/qWm8FwLb
My Personal Website is http://www.jakerpomperada.com
Email me at jakerpomperada@gmail.com and jakerpomperada@yahoo.com
Tuesday, August 18, 2020
Area of the Circle Solver in C
fgets Demonstration in C
A simple program using the C programming language to show how to use the fgets statements.
Program Listing
/* fgets.c */
/* Jake R. Pomperada,MAED-IT, MIT */
/* jakerpomperada@gmail.com */
#include <stdio.h>
#include <stdlib.h>
int main()
{
char name[50] = {0};
printf("\n");
printf("\tfgets Demonstration in C");
printf("\n\n");
printf("\tEnter your name: ");
if (fgets(name, 30, stdin)) {
printf("\n\n");
printf("\tYour name is: %s", name);
}
else {
printf("\n\n");
printf("\tIf you don't want to...");
}
return EXIT_SUCCESS;
}
Sunday, August 16, 2020
Age Checker in C
A simple program that I wrote that will ask the user to give their age and the program will check and determine whether that user age is still a minor or already an adult using C programming language.
Volume of a Sphere Converter in C
A simple program that I wrote that will ask the user to give value in radius and then the program will compute the volume of a sphere using C programming language.
Program Listing
#include <stdio.h>
#define PI 3.14
int main()
{
float volume_sphere = 0.00;
float radius = 0.00;
printf("\n\n");
printf("\tVolume of a Sphere Converter");
printf("\n\n");
printf("\tEnter Radius Value : ");
scanf("%f",&radius);
/* Compute the volume of Sphere */
volume_sphere = (4.0/3.0)*(PI*radius*radius*radius);
printf("\n\n");
printf("\tThe Volume of Sphere is %5.2f.",volume_sphere);
printf("\n\n");
printf("\tEnd of Program");
printf("\n");
}
Temperature Checker in C
A temperature program that I wrote using C programming language.
US Dollar To Philippine Peso Converter Using C language
A simple program to ask the user to give a value in US Dollar and then convert into Philippine Peso using C programming language.
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.
#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
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.
Sunday, August 9, 2020
Length of the String in C++
I wrote this simple program to find the length of the string using C++ programming language.
Months and it's Days in PHP
I wrote this program to display the months and its corresponding days using PHP programming language.
Hello World in PHP
A very simple hello world program that I wrote using PHP programming language.
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>
Friday, August 7, 2020
Tuesday, August 4, 2020
Linear Search in C Language
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");
}