Max of Two Numbers - Solidity Typing CST Test
Loading…
Max of Two Numbers — Solidity Code
Finds the maximum of two numbers.
pragma solidity ^0.8.0;
contract MaxProgram {
uint public a = 7;
uint public b = 10;
uint public max;
function findMax() public {
max = a > b ? a : b;
}
}Solidity Language Guide
Solidity is a statically typed, contract-oriented programming language designed for building smart contracts on the Ethereum blockchain. It enables developers to write decentralized applications (dApps), manage digital assets, and automate trustless logic using a syntax inspired by JavaScript, C++, and Python.
Primary Use Cases
- ▸Smart contract development
- ▸DeFi protocols (DEXs, lending, staking)
- ▸NFT standards (ERC-721, ERC-1155)
- ▸Token creation (ERC-20)
- ▸DAO governance mechanisms
- ▸Permissioned enterprise blockchain apps
Notable Features
- ▸Contract-oriented design
- ▸Strong static typing
- ▸Events for EVM logs
- ▸Function modifiers
- ▸Library & inheritance support
Origin & Creator
Solidity was created by Gavin Wood and the Ethereum Foundation in 2014 to serve as the primary language for writing smart contracts on the Ethereum blockchain.
Industrial Note
Solidity is heavily used in decentralized finance (DeFi), NFT marketplaces, blockchain gaming, DAOs, tokenization engines, supply chain tracking, on-chain governance, and enterprise blockchain automation.