C Programming Laboratory Exercises
Source code:
#include <stdio.h>
int main()
{
printf(" o o\n");
printf("<H> <H>\n");
printf("I I I I\n");
return 0;
}
Output:
Task 2: Triangle Validation
Source code:
#include <stdio.h>
int main()
{
double side1, side2, side3;
// Input three side lengths ...
Posted on Fri, 03 Jul 2026 17:40:21 +0000 by thines
Character Manipulation and ASCII Operations in C++
Determine Letter Case
Given a single character input, determine if its an uppercase letter. If so, print "yes"; otherwise, print "no".
#include <iostream>
using namespace std;
int main() {
char input;
cin >> input;
if (input >= 'A' && input <= 'Z') {
cout << "yes" ...
Posted on Thu, 02 Jul 2026 16:14:51 +0000 by the-Jerry
Basic C Programming Exercises and Code Examples
Task 1: Displaying Patterns
The following program displays a simple character pattern:
#include <stdio.h>
int main() {
printf(" O \n");
printf("<H>\n");
printf("I I\n");
printf(" O \n");
printf("<H>\n");
printf("I I\n");
return 0;
}
Ano ...
Posted on Fri, 26 Jun 2026 17:12:13 +0000 by Huuggee
Conditional Logic Functions in MySQL
MySQL provides several functions for implementing conditional logic in queries, including CASE, IF, IFNULL, and ELT functions.
Sample table structure:
+----+-----------+-----+-------+--------+
| id | name | sex | level | weight |
+----+-----------+-----+-------+--------+
| 1 | xiaohong | 1 | 1 | 50 |
| 2 | xiaoming | 0 | 0 ...
Posted on Sat, 09 May 2026 11:28:04 +0000 by shamuraq
Omitting Else Clauses with Early Returns in C Functions
Consider the classic staircase problem: given N steps, where you can climb either 1 or 2 steps at a time, calculate the total number of distinct ways to reach the top. This problem maps directly to a Fibonacci-style recurrence relation.The recursive solution can be implemented in two seemingly different ways, both yielding correct results:// Ve ...
Posted on Sat, 09 May 2026 00:33:22 +0000 by Labbat