ScrapExplorer - math.c

Home / lab / c / tiny Lines: 3 | Size: 798 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* SPDX-License-Identifier: GPL-3.0 2 * tiny 3 * 4 * math.c 5 * 6 * COPYRIGHT NOTICE 7 * Copyright (C) 2024-2025 0x4248 and contributors 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the license is not changed. 10 * 11 * This software is free and open source. Licensed under the GNU general 12 * public license version 3.0 as published by the Free Software Foundation. 13*/ 14 15#include <stdio.h> 16 17int add(int a, int b){ 18 return a + b; 19} 20 21int power(int a){ 22 return a * a; 23} 24 25int main(){ 26 27 /* Add two numbers, get the power of one and then print the results 28 * to the console. 29 */ 30 int a, b; 31 scanf("%d", &a); 32 scanf("%d", &b); 33 34 printf("The sum of %d and %d is %d\n", a, b, add(a, b)); 35 printf("%d squared is %d\n", a, power(a)); 36 return 0; 37}
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.