repo stringlengths 4 140 | commit_id stringlengths 7 7 | rel_path stringlengths 1 3.5k | language stringclasses 37
values | url stringlengths 37 3.56k | raw_url stringlengths 54 3.58k | key stringlengths 20 3.54k | ok bool 1
class | status int64 200 200 | bytes int64 48 425k | content stringlengths 40 425k | worker_id int64 0 7 |
|---|---|---|---|---|---|---|---|---|---|---|---|
FootballNewsroom/alx-low_level_programming | f0aa2ff | 0x0B-malloc_free/0-create_array.c | C | www.github.com/FootballNewsroom/alx-low_level_programming/tree/main/0x0B-malloc_free/0-create_array.c | https://raw.githubusercontent.com/FootballNewsroom/alx-low_level_programming/f0aa2ff/0x0B-malloc_free/0-create_array.c | FootballNewsroom/alx-low_level_programming f0aa2ff 0x0B-malloc_free/0-create_array.c | true | 200 | 426 | #include "main.h"
#include <stdlib.h>
/**
* create_array - creates array of size size and assign char c.
* @size: size of array.
* @c: char to assign.
*
* Return: pointer to array, NULL if fail.
*/
char *create_array(unsigned int size, char c)
{
char *str;
unsigned int i;
str = malloc(sizeof(char) * size);
... | 6 |
percona/pg_tde | 59eee8e | src/include/catalog/tde_global_space.h | C | www.github.com/percona/pg_tde/tree/main/src/include/catalog/tde_global_space.h | https://raw.githubusercontent.com/percona/pg_tde/59eee8e/src/include/catalog/tde_global_space.h | percona/pg_tde 59eee8e src/include/catalog/tde_global_space.h | true | 200 | 990 | /*-------------------------------------------------------------------------
*
* tde_global_space.h
* Global catalog key management
*
* src/include/catalog/tde_global_space.h
*
*-------------------------------------------------------------------------
*/
#ifndef TDE_GLOBAL_CATALOG_H
#define TDE_GLOBAL_CATALOG... | 5 |
EduardFrlicka/VUT-FIT-BIT | 3139221 | IAL/Proj1/c206/c206.c | C | www.github.com/EduardFrlicka/VUT-FIT-BIT/tree/main/IAL/Proj1/c206/c206.c | https://raw.githubusercontent.com/EduardFrlicka/VUT-FIT-BIT/3139221/IAL/Proj1/c206/c206.c | EduardFrlicka/VUT-FIT-BIT 3139221 IAL/Proj1/c206/c206.c | true | 200 | 10,602 |
/* c206.c **********************************************************}
{* Téma: Dvousměrně vázaný lineární seznam
**
** Návrh a referenční implementace: Bohuslav Křena, říjen 2001
** Přepracované do jazyka C: Martin Tuček, říjen 2004
** ... | 2 |
TegaBC/learning-c | 49d956a | getting_started/structs_2.c | C | www.github.com/TegaBC/learning-c/tree/main/getting_started/structs_2.c | https://raw.githubusercontent.com/TegaBC/learning-c/49d956a/getting_started/structs_2.c | TegaBC/learning-c 49d956a getting_started/structs_2.c | true | 200 | 624 | #include <stdio.h>
#include <string.h>
typedef struct
{
int angle0;
int angle1;
int angle2;
} Triangle;
int triangleIsValid(Triangle triangle)
{
if ((triangle.angle0 + triangle.angle1 + triangle.angle2) == 180)
{
printf("Triangle is a valid triangle.");
return 1; // simply, tria... | 4 |
bsour/holbertonschool-low_level_programming | 92e7972 | more_malloc_free/1-string_nconcat.c | C | www.github.com/bsour/holbertonschool-low_level_programming/tree/main/more_malloc_free/1-string_nconcat.c | https://raw.githubusercontent.com/bsour/holbertonschool-low_level_programming/92e7972/more_malloc_free/1-string_nconcat.c | bsour/holbertonschool-low_level_programming 92e7972 more_malloc_free/1-string_nconcat.c | true | 200 | 860 | #include "main.h"
#include <stdlib.h>
/**
* string_nconcat - concatenates two strings, up to n bytes of s2
* @s1: the first string
* @s2: the second string
* @n: the maximum number of bytes of s2 to concatenate
*
* Return: a pointer to the concatenated string, or NULL on failure
*/
char *string_nconcat(char *s1... | 7 |
Maix0/batou | bfcaf79 | normed/small_parse_table/small_table775.c | C | www.github.com/Maix0/batou/tree/main/normed/small_parse_table/small_table775.c | https://raw.githubusercontent.com/Maix0/batou/bfcaf79/normed/small_parse_table/small_table775.c | Maix0/batou bfcaf79 normed/small_parse_table/small_table775.c | true | 200 | 3,878 | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* funcs775.c :+: :+: :+: ... | 5 |
Nupur3051/cns-labpgs | bce7fbf | caesar.c | C | www.github.com/Nupur3051/cns-labpgs/tree/main/caesar.c | https://raw.githubusercontent.com/Nupur3051/cns-labpgs/bce7fbf/caesar.c | Nupur3051/cns-labpgs bce7fbf caesar.c | true | 200 | 1,130 | #include<stdio.h>
int main()
{
char ch,message[100];
int key,i;
printf("enter the message to be encrypted:");
scanf("%[^\n]", &message);
printf("\nenter the key:");
scanf("%d", &key);
for(i=0;message[i]!='\0';++i){
ch=message[i];
if(ch>='a'&& ch <='z'){
ch=ch+key;... | 3 |
RumataAst/push_swap | 39ffdba | srcs/turk_alg_0.c | C | www.github.com/RumataAst/push_swap/tree/main/srcs/turk_alg_0.c | https://raw.githubusercontent.com/RumataAst/push_swap/39ffdba/srcs/turk_alg_0.c | RumataAst/push_swap 39ffdba srcs/turk_alg_0.c | true | 200 | 3,188 | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* turk_alg_0.c :+: :+: :+: ... | 6 |
HALF-XD/notebook | eeabbd6 | C/csdn/skilltree/07-Pointer/exam/exam5.c | C | www.github.com/HALF-XD/notebook/tree/main/C/csdn/skilltree/07-Pointer/exam/exam5.c | https://raw.githubusercontent.com/HALF-XD/notebook/eeabbd6/C/csdn/skilltree/07-Pointer/exam/exam5.c | HALF-XD/notebook eeabbd6 C/csdn/skilltree/07-Pointer/exam/exam5.c | true | 200 | 638 | #include <stdio.h>
int max(int a, int b)
{
printf("a: %d\n", a);
printf("b: %d\n", b);
return a > b ? a : b;
}
int main(int argc, char** argv)
{
int x, y, max_val;
// int (*p_max)(int a, int b) = max; // 1
// int (*p_max)(int, int) = &max; // 2
// int *p_max(int, int) = max; // 3 error: il... | 4 |
Liemani/playground | 033ea89 | etc/seoul42/deprecated/c/struct/timeval.c | C | www.github.com/Liemani/playground/tree/main/etc/seoul42/deprecated/c/struct/timeval.c | https://raw.githubusercontent.com/Liemani/playground/033ea89/etc/seoul42/deprecated/c/struct/timeval.c | Liemani/playground 033ea89 etc/seoul42/deprecated/c/struct/timeval.c | true | 200 | 2,908 | #include <stdio.h> // printf()
#include <stddef.h> // NULL
#include <sys/time.h> // struct time
#ifndef EXECUTION
# define EXECUTION a005
#endif
// What about pointer type? and struct type?
typedef struct
{
char char1;
int int1;
} t_a0051;
typedef struct s_a0050
{
struct s_a0050 *a0050;
t_a0051 a0051;
} t_a... | 7 |
jetcxx/cxx- | 779027c | beifen/class_c/7.11/test1.c | C | www.github.com/jetcxx/cxx-/tree/main/beifen/class_c/7.11/test1.c | https://raw.githubusercontent.com/jetcxx/cxx-/779027c/beifen/class_c/7.11/test1.c | jetcxx/cxx- 779027c beifen/class_c/7.11/test1.c | true | 200 | 304 | #include <stdio.h>
int main(int argc, const char *argv[])
{
int ch;
// ch = getchar();
// printf("ch = %c %d\n",ch,ch);
int a,b,c;
a = getchar();
getchar();
b = getchar();
getchar();
c = getchar();
printf("a = %c %d\n",a,a);
printf("b = %c %d\n",b,b);
printf("c = %c %d\n",c,c);
return 0;
}
| 6 |
Serg192/uchat | cdde81b | client/src/mx_get_server_response.c | C | www.github.com/Serg192/uchat/tree/main/client/src/mx_get_server_response.c | https://raw.githubusercontent.com/Serg192/uchat/cdde81b/client/src/mx_get_server_response.c | Serg192/uchat cdde81b client/src/mx_get_server_response.c | true | 200 | 3,206 | #include "../inc/client.h"
/*
static inline int get_res_len(SSL* ssl) {
char buffer[256];
int bytes_was_read = 0;
printf("Start\n");
while((bytes_was_read = SSL_read(ssl, buffer, 256)) <= 0) {
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
continue;
}
return 0;
... | 3 |
Seif-sys/Coding-Stuff | 6c884ae | Algorithms and Data Structures/Binary Tree/binary_tree.c | C | www.github.com/Seif-sys/Coding-Stuff/tree/main/Algorithms and Data Structures/Binary Tree/binary_tree.c | https://raw.githubusercontent.com/Seif-sys/Coding-Stuff/6c884ae/Algorithms%20and%20Data%20Structures/Binary%20Tree/binary_tree.c | Seif-sys/Coding-Stuff 6c884ae Algorithms and Data Structures/Binary Tree/binary_tree.c | true | 200 | 2,537 | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct Node {
int key;
struct Node* left;
struct Node* right;
} Node;
typedef struct {
Node* root;
} BinarySearchTree;
Node* create_node(int key) {
Node* new_node = (Node*)malloc(sizeof(Node));
new_node->key = key;
new_no... | 5 |
kpatsakis/primevul7 | 8dd2061 | 143637.c | C | www.github.com/kpatsakis/primevul7/tree/main/143637.c | https://raw.githubusercontent.com/kpatsakis/primevul7/8dd2061/143637.c | kpatsakis/primevul7 8dd2061 143637.c | true | 200 | 4,944 | template<typename tz, typename tc>
CImg<T>& draw_triangle(CImg<tz>& zbuffer,
int x0, int y0, const float z0,
int x1, int y1, const float z1,
int x2, int y2, const float z2,
const CImg<tc>& texture,
... | 4 |
DanielisMaizelis/avr_learning | 549d91f | Lab 4 Project(LCD ADC UART BTN)/LCD/lcd.c | C | www.github.com/DanielisMaizelis/avr_learning/tree/main/Lab 4 Project(LCD ADC UART BTN)/LCD/lcd.c | https://raw.githubusercontent.com/DanielisMaizelis/avr_learning/549d91f/Lab%204%20Project%28LCD%20ADC%20UART%20BTN%29/LCD/lcd.c | DanielisMaizelis/avr_learning 549d91f Lab 4 Project(LCD ADC UART BTN)/LCD/lcd.c | true | 200 | 1,839 | #include "main.h"
/*void clearScreen()
{
command(0b00000110);
command(0b00000001);
_delay_ms(20);
}
void command(char cmd) // RS = 0 (Command), R/W = 0 (Write), Enable is 1
{
DATA = cmd;
CONTROL |= (1<<EN);
_delay_ms(1);
CONTROL &= 0x00;
}
void setData(char data) // RS = 1 R/W = 0, Enable = 1
{
DATA = da... | 7 |
felchion/sjever-ts | 3b2f643 | d/dali/npc/obj/doufu2.c | C | www.github.com/felchion/sjever-ts/tree/main/d/dali/npc/obj/doufu2.c | https://raw.githubusercontent.com/felchion/sjever-ts/3b2f643/d/dali/npc/obj/doufu2.c | felchion/sjever-ts 3b2f643 d/dali/npc/obj/doufu2.c | true | 200 | 340 |
inherit ITEM;
inherit F_FOOD;
void create()
{
set_name("板豆腐", ({"ban doufu", "doufu"}));
set_weight(40);
if (clonep())
set_default_object(__FILE__);
else {
set("long", "一块普通的家常豆腐,散发着清香。\n");
set("unit", "块");
set("value", 70);
set("food_remaining", 1);
set("food_supply", 80);
}
}
| 6 |
DeviousCardi/BTP | 720b738 | deepfix_data/prob43/erroneous/prog21195-user666.c | C | www.github.com/DeviousCardi/BTP/tree/main/deepfix_data/prob43/erroneous/prog21195-user666.c | https://raw.githubusercontent.com/DeviousCardi/BTP/720b738/deepfix_data/prob43/erroneous/prog21195-user666.c | DeviousCardi/BTP 720b738 deepfix_data/prob43/erroneous/prog21195-user666.c | true | 200 | 336 | #include <stdio.h>
#include <stdlib.h>
double fg(double x) {
double z;
z=2*x*x*x-8*x;
return z; }
int main() {
double a,b,A;int n;
scanf("%lf%lf%d",a,b,n);
double delx,delA;
delx=(b-a)/n;
A=0;
for(i=0;i<n;i=i+1) {
delA=fg(a+i*(delx));
if(delA<0){delA=-delA;}
A=A+delA; }
printf("%.4lf",... | 4 |
lekakenycollins8/alx-low_level_programming | 91f7622 | 0x05-pointers_arrays_strings/5-rev_string.c | C | www.github.com/lekakenycollins8/alx-low_level_programming/tree/main/0x05-pointers_arrays_strings/5-rev_string.c | https://raw.githubusercontent.com/lekakenycollins8/alx-low_level_programming/91f7622/0x05-pointers_arrays_strings/5-rev_string.c | lekakenycollins8/alx-low_level_programming 91f7622 0x05-pointers_arrays_strings/5-rev_string.c | true | 200 | 320 | #include <stdio.h>
/**
* rev_string - Entry point
* Reverses a string
* @s: pointer to string
*/
void rev_string(char *s)
{
int length = 0;
int i;
while (s[length] != '\0')
{
length++;
}
for (i = 0; i < length / 2; i++)
{
char temp = s[i];
s[i] = s[length - i - 1];
s[length - i - 1] = temp;
}
}
| 3 |
alaviss/mcu-bounce | 410adb6 | vendor/same51/include/instance/nvmctrl.h | C | www.github.com/alaviss/mcu-bounce/tree/main/vendor/same51/include/instance/nvmctrl.h | https://raw.githubusercontent.com/alaviss/mcu-bounce/410adb6/vendor/same51/include/instance/nvmctrl.h | alaviss/mcu-bounce 410adb6 vendor/same51/include/instance/nvmctrl.h | true | 200 | 1,853 | /*
* Instance header file for ATSAME51N20A
*
* Copyright (c) 2024 Microchip Technology Inc. and its subsidiaries.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | 4 |
Abdelhalim-lhm/alx-low_level_programming | bd5e468 | 0x02-functions_nested_loops/11-print_to_98.c | C | www.github.com/Abdelhalim-lhm/alx-low_level_programming/tree/main/0x02-functions_nested_loops/11-print_to_98.c | https://raw.githubusercontent.com/Abdelhalim-lhm/alx-low_level_programming/bd5e468/0x02-functions_nested_loops/11-print_to_98.c | Abdelhalim-lhm/alx-low_level_programming bd5e468 0x02-functions_nested_loops/11-print_to_98.c | true | 200 | 346 | #include "main.h"
/**
* print_to_98 - a function that print number from n to 98
* @n: initial number
* Return: 0 On success
*/
void print_to_98(int n)
{
int i;
if (n < 98)
{
for (i = n ; i < 98 ; i++)
{
printf("%i, ", i);
}
}
else if (n > 98)
{
for (i = n ; i > 98 ; i--)
{
printf("%i, ", i);
... | 3 |
itsPeterDenman/blueberryMouse | c64ed4c | src/bluetoothSetup.c | C | www.github.com/itsPeterDenman/blueberryMouse/tree/main/src/bluetoothSetup.c | https://raw.githubusercontent.com/itsPeterDenman/blueberryMouse/c64ed4c/src/bluetoothSetup.c | itsPeterDenman/blueberryMouse c64ed4c src/bluetoothSetup.c | true | 200 | 1,453 | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
#include "../include/bluetoothSetup.h"
int initialize() {
printf("Initializing bluetooth connection... \n");
system("sudo hciconfig hci0 up"); /... | 5 |
csheung/Graph-Navigator-in-C | 8acb2c9 | my_dll.h | C | www.github.com/csheung/Graph-Navigator-in-C/tree/main/my_dll.h | https://raw.githubusercontent.com/csheung/Graph-Navigator-in-C/8acb2c9/my_dll.h | csheung/Graph-Navigator-in-C 8acb2c9 my_dll.h | true | 200 | 12,018 | // =================== Support Code =================
// Doubly Linked List ( DLL ).
//
//
//
// - Implement each of the functions to create a working DLL.
// - Do not change any of the function declarations
// - (i.e. dll_t* create_dll() should not have additional arguments)
// - You should not have any 'printf' sta... | 7 |
Akshat-singla/Code-Radar-Solutions | 50452da | Check Triangle Validity@@6788dd63490637cfc44e1b93/code.c | C | www.github.com/Akshat-singla/Code-Radar-Solutions/tree/main/Check Triangle Validity@@6788dd63490637cfc44e1b93/code.c | https://raw.githubusercontent.com/Akshat-singla/Code-Radar-Solutions/50452da/Check%20Triangle%20Validity%40%406788dd63490637cfc44e1b93/code.c | Akshat-singla/Code-Radar-Solutions 50452da Check Triangle Validity@@6788dd63490637cfc44e1b93/code.c | true | 200 | 195 | #include<stdio.h>
void main(){
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (a + b > c && a + c > b && b + c > a) {
printf("Valid\n");
} else {
printf("Invalid\n");
}
} | 6 |
cc-qing/libplacebo | ccd4eda | libplacebo/3rdparty/glad/test/c/run/gl/default/001/test.c | C | www.github.com/cc-qing/libplacebo/tree/main/libplacebo/3rdparty/glad/test/c/run/gl/default/001/test.c | https://raw.githubusercontent.com/cc-qing/libplacebo/ccd4eda/libplacebo/3rdparty/glad/test/c/run/gl/default/001/test.c | cc-qing/libplacebo ccd4eda libplacebo/3rdparty/glad/test/c/run/gl/default/001/test.c | true | 200 | 1,588 | /*
* Core 3.3 profile using glfw to load
*
* GLAD: $GLAD --out-path=$tmp --api="gl:core" c
* COMPILE: $GCC -Wno-pedantic $test -o $tmp/test -I$tmp/include $tmp/src/gl.c -ldl -lglfw
* RUN: $tmp/test
*/
#include <stdio.h>
#include <stdlib.h>
#include <glad/gl.h>
#include <GLFW/glfw3.h>
#define ASSERT... | 3 |
Ojpaapy/alx-low_level_programming | b4a911c | 0x01-variables_if_else_while/8-print_base16.c | C | www.github.com/Ojpaapy/alx-low_level_programming/tree/main/0x01-variables_if_else_while/8-print_base16.c | https://raw.githubusercontent.com/Ojpaapy/alx-low_level_programming/b4a911c/0x01-variables_if_else_while/8-print_base16.c | Ojpaapy/alx-low_level_programming b4a911c 0x01-variables_if_else_while/8-print_base16.c | true | 200 | 306 | #include <stdlib.h>
#include <time.h>
#include <stdio.h>
/**
* main - running hexadecimal
* Return: 0 (Success)
*/
int main(void)
{
int num;
char letter;
for (num = 0; num < 10; num++)
putchar((num % 10) + '0');
for (letter = 'a'; letter <= 'f'; letter++)
putchar(letter);
putchar ('\n');
return (0);
}
| 4 |
nyo/42born2code | b8b992b | minishell/srcs/env_to_environ.c | C | www.github.com/nyo/42born2code/tree/main/minishell/srcs/env_to_environ.c | https://raw.githubusercontent.com/nyo/42born2code/b8b992b/minishell/srcs/env_to_environ.c | nyo/42born2code b8b992b minishell/srcs/env_to_environ.c | true | 200 | 3,315 | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* env_to_environ.c :+: :+: :+: ... | 7 |
maya33/alx-low_level_programming | 30ff959 | 0x08-recursion/100-is_palindrome.c | C | www.github.com/maya33/alx-low_level_programming/tree/main/0x08-recursion/100-is_palindrome.c | https://raw.githubusercontent.com/maya33/alx-low_level_programming/30ff959/0x08-recursion/100-is_palindrome.c | maya33/alx-low_level_programming 30ff959 0x08-recursion/100-is_palindrome.c | true | 200 | 1,150 | #include "main.h"
int find_strlen(char *s);
int check_palindrome(char *s, int len, int index);
int is_palindrome(char *s);
/**
* a function that returns 1 if a string is a palindrome and 0 if no
*@s: string
* Return: The length of the string.
*/
int find_strlen(char *s)
{
int len = 0;
if (*(s + len))
{
len+... | 5 |
ryukans/repos | db9ccb5 | C/getline.c | C | www.github.com/ryukans/repos/tree/main/C/getline.c | https://raw.githubusercontent.com/ryukans/repos/db9ccb5/C/getline.c | ryukans/repos db9ccb5 C/getline.c | true | 200 | 385 | #include <stdio.h>
#define MAXSIZE 5
void getline(char line[], int maxline);
int main()
{
char line[MAXSIZE];
getline(line, MAXSIZE);
printf("\n%s\n", line);
return 0;
}
void getline(char s[], int lim)
{
int c, i;
for(i=0; i<lim-1 && (c=getchar())!=EOF; ++i)
s[i] = c;
if(c == ... | 6 |
cronopi/pipiex | 25923bb | libft/ft_strtrim.c | C | www.github.com/cronopi/pipiex/tree/main/libft/ft_strtrim.c | https://raw.githubusercontent.com/cronopi/pipiex/25923bb/libft/ft_strtrim.c | cronopi/pipiex 25923bb libft/ft_strtrim.c | true | 200 | 2,225 | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strtrim.c :+: :+: :+: ... | 4 |
codingbelhaous/alx-low_level_programming | c7131e0 | 0x05-pointers_arrays_strings/4-print_rev.c | C | www.github.com/codingbelhaous/alx-low_level_programming/tree/main/0x05-pointers_arrays_strings/4-print_rev.c | https://raw.githubusercontent.com/codingbelhaous/alx-low_level_programming/c7131e0/0x05-pointers_arrays_strings/4-print_rev.c | codingbelhaous/alx-low_level_programming c7131e0 0x05-pointers_arrays_strings/4-print_rev.c | true | 200 | 289 | #include "main.h"
/**
* print_rev - function that print a string in reverse
*
* @s: the string to br reversed
*
* Return: void
*/
void print_rev(char *s)
{
int i;
i = 0;
while (s[i] != '\0')
{
i++;
}
i--;
while (i >= 0)
{
_putchar(s[i]);
i--;
}
_putchar('\n');
}
| 3 |
kpatsakis/primevul9 | de9fd13 | 195782.c | C | www.github.com/kpatsakis/primevul9/tree/main/195782.c | https://raw.githubusercontent.com/kpatsakis/primevul9/de9fd13/195782.c | kpatsakis/primevul9 de9fd13 195782.c | true | 200 | 1,365 | static int types_equal(const struct cli_bc *bc, uint16_t *apity2ty, uint16_t tid, uint16_t apitid)
{
unsigned i;
const struct cli_bc_type *ty = &bc->types[tid - 65];
const struct cli_bc_type *apity = &cli_apicall_types[apitid];
/* If we've already verified type equality, return.
* Since we need to ... | 7 |
njorogendegwajoseph/alx-low_level_programming | 05c6575 | 0x0E-structures_typedef/5-free_dog.c | C | www.github.com/njorogendegwajoseph/alx-low_level_programming/tree/main/0x0E-structures_typedef/5-free_dog.c | https://raw.githubusercontent.com/njorogendegwajoseph/alx-low_level_programming/05c6575/0x0E-structures_typedef/5-free_dog.c | njorogendegwajoseph/alx-low_level_programming 05c6575 0x0E-structures_typedef/5-free_dog.c | true | 200 | 206 | #include "dog.h"
#include <stdlib.h>
/**
* free-dog: free memory of te dog.
* @d: pointer to the dog
*/
void free_dog(dog_t *d)
{
if (d == NULL)
return;
free(d->owner);
free(d->name);
free(d);
}
| 6 |
21A91A05D8/codemind-c | 5bd42af | sum_of_first_half_and_second_half_in_an_array.c | C | www.github.com/21A91A05D8/codemind-c/tree/main/sum_of_first_half_and_second_half_in_an_array.c | https://raw.githubusercontent.com/21A91A05D8/codemind-c/5bd42af/sum_of_first_half_and_second_half_in_an_array.c | 21A91A05D8/codemind-c 5bd42af sum_of_first_half_and_second_half_in_an_array.c | true | 200 | 338 | #include<stdio.h>
int main()
{
int i,a[100],fs=0,ss=0,n;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(i<n/2)
{
fs=fs+a[i];
}
else
{
ss=ss+a[i];
}
}
printf("%d
",fs);
p... | 4 |
pa45h/PPS | 63ba7ac | C9_Structure&Union/union.c | C | www.github.com/pa45h/PPS/tree/main/C9_Structure&Union/union.c | https://raw.githubusercontent.com/pa45h/PPS/63ba7ac/C9_Structure%26Union/union.c | pa45h/PPS 63ba7ac C9_Structure&Union/union.c | true | 200 | 939 | #include <stdio.h>
#include <string.h>
union data
{
int i; // 4 bytes
float f; // 4 bytes
int arr[5]; // 20 bytes
char str[15]; // 15 bytes
} u; // sizeof(u) = MaxOf(all) = 20 bytes
struct dataS
{
int i; // 4 bytes
float f; // 4 bytes
i... | 3 |
elfabri/bdd-memory-managment--12 | efa2f4f | 11_Mark-and-Sweep/2_pros-cons/main.c | C | www.github.com/elfabri/bdd-memory-managment--12/tree/main/11_Mark-and-Sweep/2_pros-cons/main.c | https://raw.githubusercontent.com/elfabri/bdd-memory-managment--12/efa2f4f/11_Mark-and-Sweep/2_pros-cons/main.c | elfabri/bdd-memory-managment--12 efa2f4f 11_Mark-and-Sweep/2_pros-cons/main.c | true | 200 | 1,712 | #define MUNIT_ENABLE_ASSERT_ALIASES
#include <stdio.h>
#include <stdlib.h>
// #include "bootlib.h"
#include "munit.h"
#include "vm.h"
/*
munit_case(RUN, test_vm_new, {
vm_t *vm = vm_new();
assert_int(vm->frames->capacity, ==, 8, "frames should have capacity 8");
assert_int(vm->objects->capacity, ==, 8, "objects ... | 7 |
Etie03/alx-low_level_programming | d230141 | 0x08-recursion/100-is_palindrome.c | C | www.github.com/Etie03/alx-low_level_programming/tree/main/0x08-recursion/100-is_palindrome.c | https://raw.githubusercontent.com/Etie03/alx-low_level_programming/d230141/0x08-recursion/100-is_palindrome.c | Etie03/alx-low_level_programming d230141 0x08-recursion/100-is_palindrome.c | true | 200 | 881 | #include "main.h"
/**
* _strlen_recursion - a function that gets the length of a string
* @s: the string
*
* Return: length of the string
*/
int _strlen_recursion(char *s)
{
if (*s == '\0')
{
return (0);
}
s++;
return (_strlen_recursion(s) + 1);
}
/**
* comparator - a function that compares each character... | 5 |
E2-Karishma-87218/C_Assignments | 5613e57 | Second_C_Assignment/Q9_ifelseladder.c | C | www.github.com/E2-Karishma-87218/C_Assignments/tree/main/Second_C_Assignment/Q9_ifelseladder.c | https://raw.githubusercontent.com/E2-Karishma-87218/C_Assignments/5613e57/Second_C_Assignment/Q9_ifelseladder.c | E2-Karishma-87218/C_Assignments 5613e57 Second_C_Assignment/Q9_ifelseladder.c | true | 200 | 957 | #include <stdio.h>
int isLeapYear(int year) {
return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
}
int getDaysInMonth(int month, int year)
{
if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
{
return 31;
}
else if (month == 4 ||... | 6 |
maykon117/Atividade_programacao | 9321389 | questao09.c | C | www.github.com/maykon117/Atividade_programacao/tree/main/questao09.c | https://raw.githubusercontent.com/maykon117/Atividade_programacao/9321389/questao09.c | maykon117/Atividade_programacao 9321389 questao09.c | true | 200 | 333 | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
int x, antecessor, sucessor;
printf("Digite um valor inteiro ou seja positivo \n");
scanf("%d",&x);
antecessor=x-1;
sucessor=x+1;
printf("Valores sucessores %d \nValores antecessor %d",sucessor,antecessor);
... | 4 |
wangxuejun1972/json-parser-example | 476b7b8 | example/13_update_arr.c | C | www.github.com/wangxuejun1972/json-parser-example/tree/main/example/13_update_arr.c | https://raw.githubusercontent.com/wangxuejun1972/json-parser-example/476b7b8/example/13_update_arr.c | wangxuejun1972/json-parser-example 476b7b8 example/13_update_arr.c | true | 200 | 786 | #include "json_parser.h"
#include "util.h"
void arr_update() {
json_value_t *json = create_test_arr();
printf("\n---------- origin json ------------\n");
print_json_value(json, 0);
json_array_t *arr = json_value_array(json);
const json_value_t *arr_cursor = NULL;
int index = 0;
json_array_for_each(arr_c... | 7 |
Mina-Karam/Gear-Up-C-Tasks | 867ff36 | Complex/complex.c | C | www.github.com/Mina-Karam/Gear-Up-C-Tasks/tree/main/Complex/complex.c | https://raw.githubusercontent.com/Mina-Karam/Gear-Up-C-Tasks/867ff36/Complex/complex.c | Mina-Karam/Gear-Up-C-Tasks 867ff36 Complex/complex.c | true | 200 | 2,588 | #include <stdio.h>
#include <assert.h>
#include "complex.h"
/* Creation */
//Add your code here
COMPLEX CreateComplex(double real, double imaginary)
{
COMPLEX create_complex;
create_complex.real = real;
create_complex.imaginary = imaginary;
return create_complex;
}
// End of your code
/* Destructi... | 5 |
kd1387066/clang2024 | c3ee19f | dekuri.2.c | C | www.github.com/kd1387066/clang2024/tree/main/dekuri.2.c | https://raw.githubusercontent.com/kd1387066/clang2024/c3ee19f/dekuri.2.c | kd1387066/clang2024 c3ee19f dekuri.2.c | true | 200 | 316 | #include<stdio.h>
main() {
char moji[21];//������\0���邩��
int i, k[20];
printf("���������͂��Ă��������F");
scanf("%s", &moji[0]);
for (i = 0; moji[i] != '\0'; i++) {
printf("moji[%d]�̕������L�[>",i);
scanf("%d", &k[i]);
moji[i] = moji[i] - k[i];
}
printf("�������ςݕ�����́A%s",& moji[0]);
} | 6 |
SAURABHM6341/c-programming-language-codes | a309780 | miscellaneous/hcf.c | C | www.github.com/SAURABHM6341/c-programming-language-codes/tree/main/miscellaneous/hcf.c | https://raw.githubusercontent.com/SAURABHM6341/c-programming-language-codes/a309780/miscellaneous/hcf.c | SAURABHM6341/c-programming-language-codes a309780 miscellaneous/hcf.c | true | 200 | 535 | #include <stdio.h>
int min(int a, int b)
{
if (a > b)
{
return b;
}
else
return a;
}
int hcf(int num1, int num2)
{
int e;
for (int i = 1; i <= min(num1, num2); i++)
{
if (num1 % i == 0 && num2 % i == 0)
{
e = i;
}
else
... | 4 |
qazwsxdshb/ntut_cs1_2 | 2121bb6 | hw024.c | C | www.github.com/qazwsxdshb/ntut_cs1_2/tree/main/hw024.c | https://raw.githubusercontent.com/qazwsxdshb/ntut_cs1_2/2121bb6/hw024.c | qazwsxdshb/ntut_cs1_2 2121bb6 hw024.c | true | 200 | 688 | #include <stdio.h>
typedef struct student_s{
char name[50];
int score;
}student;
void input(student stu[], int co){
for(int i=0;i<co;i++){
scanf("%s",stu[i].name);
scanf("%d",&stu[i].score);
}
}
void getHigh(student stu[],int co){
int max=0,maxpointer;
for(int i=0;i<co;i++){
i... | 3 |
Angela-Muchuni/alx-low_level_programming | 25b39b4 | 0x0A-argc_argv/1-args.c | C | www.github.com/Angela-Muchuni/alx-low_level_programming/tree/main/0x0A-argc_argv/1-args.c | https://raw.githubusercontent.com/Angela-Muchuni/alx-low_level_programming/25b39b4/0x0A-argc_argv/1-args.c | Angela-Muchuni/alx-low_level_programming 25b39b4 0x0A-argc_argv/1-args.c | true | 200 | 309 | #include <stdio.h>
#include "main.h"
/**
* main - a program that prints the number of arguments
* passed into it.
* @argv: array of arguments
* @argc: number of arguments
* Return: 0(success)
*/
int main(int argc, char *argv[])
{
(void) argv; /*Ignore argv*/
printf("%d\n", argc - 1);
return (0);
}
| 1 |
murrdevv/alx-low_level_programming | 4d9e8e4 | 0x14-bit_manipulation/3-set_bit.c | C | www.github.com/murrdevv/alx-low_level_programming/tree/main/0x14-bit_manipulation/3-set_bit.c | https://raw.githubusercontent.com/murrdevv/alx-low_level_programming/4d9e8e4/0x14-bit_manipulation/3-set_bit.c | murrdevv/alx-low_level_programming 4d9e8e4 0x14-bit_manipulation/3-set_bit.c | true | 200 | 376 | #include "main.h"
/**
* set_bit - function that sets the value of a bit to 1 at a given index.
* @n: pointer to a number
* @index:
*
* Return: 1 (Sucess) else -1
*/
int set_bit(unsigned long int *n, unsigned int index)
{
if (index > 64)
return (-1);
if (!((*n >> index) & 1))
{
*n += 1... | 7 |
tuongducthanh/Tinhoccoso2ptit | b63864a | phuongtrinhbacnhat.c | C | www.github.com/tuongducthanh/Tinhoccoso2ptit/tree/main/phuongtrinhbacnhat.c | https://raw.githubusercontent.com/tuongducthanh/Tinhoccoso2ptit/b63864a/phuongtrinhbacnhat.c | tuongducthanh/Tinhoccoso2ptit b63864a phuongtrinhbacnhat.c | true | 200 | 195 | #include<stdio.h>
int main(){
float a,b;
scanf("%f %f", &a,&b);
if(a!=0)
{
printf("%.2f", -b/a);
}
else
{
if(b==0) printf("Vo so nghiem");
else printf("Vo nghiem");
}
return 0;
}
| 5 |
BigZaya/alx-low_level_programming | dfbe862 | 0x01-variables_if_else_while/3-print_alphabets.c | C | www.github.com/BigZaya/alx-low_level_programming/tree/main/0x01-variables_if_else_while/3-print_alphabets.c | https://raw.githubusercontent.com/BigZaya/alx-low_level_programming/dfbe862/0x01-variables_if_else_while/3-print_alphabets.c | BigZaya/alx-low_level_programming dfbe862 0x01-variables_if_else_while/3-print_alphabets.c | true | 200 | 284 | #include <stdio.h>
/**
* main - Entry point
*
* Return: Always 0 (Success)
*/
int main(void)
{
char Lower = 'a';
char Upper = 'A';
while (Lower <= 'z')
{
putchar(Lower);
Lower++;
}
while (Upper <= 'Z')
{
putchar(Upper);
Upper++;
}
putchar('\n');
return (0);
}
| 0 |
guilhermwnpy/Microcontroladores | 69d626c | Exemplos/01 Exemplos Portas e Saidas/Exemplo 3/Exemplo3.c | C | www.github.com/guilhermwnpy/Microcontroladores/tree/main/Exemplos/01 Exemplos Portas e Saidas/Exemplo 3/Exemplo3.c | https://raw.githubusercontent.com/guilhermwnpy/Microcontroladores/69d626c/Exemplos/01%20Exemplos%20Portas%20e%20Saidas/Exemplo%203/Exemplo3.c | guilhermwnpy/Microcontroladores 69d626c Exemplos/01 Exemplos Portas e Saidas/Exemplo 3/Exemplo3.c | true | 200 | 556 | void main()
{
unsigned char J = 1; //Inicializamos J = 1.
ANSEL = 0; // Configura os pinos AN (anal�gicos) como digitais
ANSELH = 0;
C1ON_bit = 0; // Desabilita os comparadores
C2ON_bit = 0;
TRISB = 0; //Toda a porta B ser� sa�da
PORTB = 0; //Toda a porta B igual a 0
while(1) //la�o infinito
{
PORT... | 2 |
hasangumus0707/C_Programming_Language | 4f5887e | Visual_Studio-C/Struct/pointer_struct.c | C | www.github.com/hasangumus0707/C_Programming_Language/tree/main/Visual_Studio-C/Struct/pointer_struct.c | https://raw.githubusercontent.com/hasangumus0707/C_Programming_Language/4f5887e/Visual_Studio-C/Struct/pointer_struct.c | hasangumus0707/C_Programming_Language 4f5887e Visual_Studio-C/Struct/pointer_struct.c | true | 200 | 757 | #include <stdio.h>
#include <string.h>
struct books{
char* bookname;
char* writer;
int page;
int year;
};
void print_me (struct books*);
int main(){
struct books x;
struct books* y;
y = &x;
(*y).bookname = "Harry Potter";
(*y).writer = "Hasan Flanagan";
(*y).page = 405;
... | 4 |
artanvir19/C-Programming | efd9bf3 | Simple_C_program/4-03-22.bubble_short_using_pointer.c | C | www.github.com/artanvir19/C-Programming/tree/main/Simple_C_program/4-03-22.bubble_short_using_pointer.c | https://raw.githubusercontent.com/artanvir19/C-Programming/efd9bf3/Simple_C_program/4-03-22.bubble_short_using_pointer.c | artanvir19/C-Programming efd9bf3 Simple_C_program/4-03-22.bubble_short_using_pointer.c | true | 200 | 935 | #include<stdio.h>
#define SIZE 10
void bubblesort(int *const array,const size_t size);
int main()
{
int a[SIZE]={2,6,4,8,10,12,89,68,45,37};
puts ("Data items in original order ");
for(size_t i=0;i<SIZE;++i)
{
printf("%4d",a[i]);
}
bubblesort(a,SIZE);
puts("\n D... | 3 |
chukwuemekaumesi/alx-low_level_programming | 520554c | 0x13-more_singly_linked_lists/9-insert_nodeint.c | C | www.github.com/chukwuemekaumesi/alx-low_level_programming/tree/main/0x13-more_singly_linked_lists/9-insert_nodeint.c | https://raw.githubusercontent.com/chukwuemekaumesi/alx-low_level_programming/520554c/0x13-more_singly_linked_lists/9-insert_nodeint.c | chukwuemekaumesi/alx-low_level_programming 520554c 0x13-more_singly_linked_lists/9-insert_nodeint.c | true | 200 | 1,160 | #include "lists.h"
/**
* create_new_node - to create new node
* @n: the integer it accepts
* Return: pointer to the node
*/
listint_t *create_new_node(int n)
{
listint_t *new;
new = malloc(sizeof(listint_t));
if (new == NULL)
return (NULL);
new->n = n;
new->next = NULL;
return (new);
}
/**
* insert_no... | 6 |
biesnecker/advent_c | 62991c2 | src/2016/day_six.c | C | www.github.com/biesnecker/advent_c/tree/main/src/2016/day_six.c | https://raw.githubusercontent.com/biesnecker/advent_c/62991c2/src/2016/day_six.c | biesnecker/advent_c 62991c2 src/2016/day_six.c | true | 200 | 1,562 | #include <stdint.h>
#include "../common.h"
#define COLCOUNT 8
typedef struct counts {
uint32_t counts[COLCOUNT][26];
} counts;
static void
readInput(FILE* fp, void (*handler)(const char*, void*), void* userData) {
char buffer[16];
while (fscanf(fp, "%s\n", buffer) != EOF) {
handler(buffer, userD... | 1 |
Somashekhar7984/Dining-philosophers-OS-Theory-Assignment- | cd4875a | Dining Philospher's Implementation/PASUMARTHI_SOMASHEKHAR_B200836CS_ASSIGN_3_Q1.c | C | www.github.com/Somashekhar7984/Dining-philosophers-OS-Theory-Assignment-/tree/main/Dining Philospher's Implementation/PASUMARTHI_SOMASHEKHAR_B200836CS_ASSIGN_3_Q1.c | https://raw.githubusercontent.com/Somashekhar7984/Dining-philosophers-OS-Theory-Assignment-/cd4875a/Dining%20Philospher%27s%20Implementation/PASUMARTHI_SOMASHEKHAR_B200836CS_ASSIGN_3_Q1.c | Somashekhar7984/Dining-philosophers-OS-Theory-Assignment- cd4875a Dining Philospher's Implementation/PASUMARTHI_SOMASHEKHAR_B200836CS_ASSIGN_3_Q1.c | true | 200 | 1,566 | #include<stdio.h>
#include<pthread.h>
#include<assert.h>
#include<semaphore.h>
static volatile int counter = 0;
pthread_mutex_t soma;
void *thread_increment(void *c){
//printf("%s : beginning of increment thread \n", (char*) c);
int i = 0;
while(i < 1e7){
pthread_mutex_lock(&soma);
... | 7 |
chowe99/Project-2 | 4633ce8 | hashtable/milliseconds.c | C | www.github.com/chowe99/Project-2/tree/main/hashtable/milliseconds.c | https://raw.githubusercontent.com/chowe99/Project-2/4633ce8/hashtable/milliseconds.c | chowe99/Project-2 4633ce8 hashtable/milliseconds.c | true | 200 | 321 | #include <inttypes.h>
#include <sys/time.h>
// RETURNS THE CURRENT TIME, AS A NUMBER OF MILLISECONDS, IN A 64-bit INTEGER
int64_t milliseconds(void)
{
struct timeval now;
gettimeofday( &now, NULL ); // timezone not required, so we pass NULL
return ((int64_t)now.tv_sec * 1000) + now.tv_usec/1000;
}... | 5 |
pjastr/ProgramowanieStrukturalne2023 | e106a19 | Wyklad12/w12_4/main.c | C | www.github.com/pjastr/ProgramowanieStrukturalne2023/tree/main/Wyklad12/w12_4/main.c | https://raw.githubusercontent.com/pjastr/ProgramowanieStrukturalne2023/e106a19/Wyklad12/w12_4/main.c | pjastr/ProgramowanieStrukturalne2023 e106a19 Wyklad12/w12_4/main.c | true | 200 | 453 | #include <stdio.h>
struct Punkt2D {
float x;
float y;
};
void przesun_punkt(struct Punkt2D *p, float dx, float dy) {
p->x += dx;
p->y += dy;
}
int main() {
struct Punkt2D punkt = {3.0, 4.0};
printf("Punkt przed przesunieciem: (%.1f, %.1f)\n", punkt.x, punkt.y);
przesun_punkt(&punkt, 2.0, ... | 0 |
muneebahmadbhat/cLanguagebYMuneeb | 6a04e40 | imp6.c | C | www.github.com/muneebahmadbhat/cLanguagebYMuneeb/tree/main/imp6.c | https://raw.githubusercontent.com/muneebahmadbhat/cLanguagebYMuneeb/6a04e40/imp6.c | muneebahmadbhat/cLanguagebYMuneeb 6a04e40 imp6.c | true | 200 | 265 | #include <stdio.h>
void main (){
int a = 0,b=1,n,temp;
printf("ENter the no you want fibonacci of");
scanf("%d",&n);
for (int i = 0; i <= n-1; i++)
{
b = a+b;
a=b-a;
}
printf("the fibonacci of %d is %d",n,a);
} | 4 |
meenalochanajami/codemind-c | f62925b | average_element_is_in_array_or_not.c | C | www.github.com/meenalochanajami/codemind-c/tree/main/average_element_is_in_array_or_not.c | https://raw.githubusercontent.com/meenalochanajami/codemind-c/f62925b/average_element_is_in_array_or_not.c | meenalochanajami/codemind-c f62925b average_element_is_in_array_or_not.c | true | 200 | 465 | #include<stdio.h>
int main()
{
int n,i,s1=0,flag=0;
scanf("%d",&n);
int a[n];
int avg;
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
s1=s1+a[i];
}
avg=s1/n;
scanf("%d",&avg);
for(i=0;i<n;i++)
{
if(avg==a[i])
{
... | 6 |
altair1990e/alx-low_level_programming | b02e6a4 | 0x07-pointers_arrays_strings/1-memcpy.c | C | www.github.com/altair1990e/alx-low_level_programming/tree/main/0x07-pointers_arrays_strings/1-memcpy.c | https://raw.githubusercontent.com/altair1990e/alx-low_level_programming/b02e6a4/0x07-pointers_arrays_strings/1-memcpy.c | altair1990e/alx-low_level_programming b02e6a4 0x07-pointers_arrays_strings/1-memcpy.c | true | 200 | 527 | #include "main.h"
/**
* _memcpy - copies @n bytes from the memory area pointed
* to by @src into that pointed to by @dest
* @dest: a pointer to the memory area to copy @src into
* @src: the source buffer to copy characters from
* @n: the number of bytes to copy from source
*
* Return: to @dest
*/
char *_memcp... | 2 |
Owendrinkwater/alx-low_level_programming | a07dd63 | 0x04-more_functions_nested_loops/6-print_lines.c | C | www.github.com/Owendrinkwater/alx-low_level_programming/tree/main/0x04-more_functions_nested_loops/6-print_lines.c | https://raw.githubusercontent.com/Owendrinkwater/alx-low_level_programming/a07dd63/0x04-more_functions_nested_loops/6-print_lines.c | Owendrinkwater/alx-low_level_programming a07dd63 0x04-more_functions_nested_loops/6-print_lines.c | true | 200 | 299 | #include "main.h"
/**
* print_line - draws a straight line in the terminal
* @n: number of times the character _ should be printed
*/
void print_line(int n)
{
int i;
for (i = 0; i <= n; i++)
{
if (n <= 0)
{
_putchar('\n');
}
else
{
_putchar('_');
}
_putchar('\n');
}
}
| 3 |
INAHIDC/randomweirdstuff | 7c5e7ad | 2x2.c | C | www.github.com/INAHIDC/randomweirdstuff/tree/main/2x2.c | https://raw.githubusercontent.com/INAHIDC/randomweirdstuff/7c5e7ad/2x2.c | INAHIDC/randomweirdstuff 7c5e7ad 2x2.c | true | 200 | 350 | #include <cs50.h>
#include <stdio.h>
int main(void)
{
int length;
do
{
length = get_int("Length: ");
}
while (length < 1);
int twice[length];
twice[0] = 1;
printf("%i\n", twice[0]);
for (int i = 1; i < length; i++)
{
twice[i] = 2 * twice[i - 1];
prin... | 1 |
LSL-sanqiumu/smartLock | bf42cc8 | Hardware/ESP8266.c | C | www.github.com/LSL-sanqiumu/smartLock/tree/main/Hardware/ESP8266.c | https://raw.githubusercontent.com/LSL-sanqiumu/smartLock/bf42cc8/Hardware/ESP8266.c | LSL-sanqiumu/smartLock bf42cc8 Hardware/ESP8266.c | true | 200 | 4,160 | #include "stm32f10x.h" // Device header
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "ESP8266.h"
#include "MyDelay.h"
#include "SerialLog.h"
#include "string.h"
extern TimerHandle_t Timer1_Handle;
char buff[512];
uint16_t buff_index;
uint8_t receive_flag;
uint8_t buff_init_f... | 7 |
PrincessRuth90/alx-low_level_programming | fb18290 | 0x05-pointers_arrays_strings/5-rev_string.c | C | www.github.com/PrincessRuth90/alx-low_level_programming/tree/main/0x05-pointers_arrays_strings/5-rev_string.c | https://raw.githubusercontent.com/PrincessRuth90/alx-low_level_programming/fb18290/0x05-pointers_arrays_strings/5-rev_string.c | PrincessRuth90/alx-low_level_programming fb18290 0x05-pointers_arrays_strings/5-rev_string.c | true | 200 | 328 | #include "main.h"
/**
* rev_string - prints reverse string
* @s: pointer to the string to print
* Return: void
*/
void rev_string(char *s)
{
int len, i, half;
char temp;
for (len = 0; s[len] != '\0'; len++)
;
i = 0;
half = len / 2;
while (half--)
{
temp = s[len - i - 1];
s[len - i - 1] = s[i];
s[i] = temp;
i+... | 5 |
piotrusio02/PS169351 | 8b8cb71 | zadanie z lekcji/15.04, wariant 843.c | C | www.github.com/piotrusio02/PS169351/tree/main/zadanie z lekcji/15.04, wariant 843.c | https://raw.githubusercontent.com/piotrusio02/PS169351/8b8cb71/zadanie%20z%20lekcji/15.04%2C%20wariant%20843.c | piotrusio02/PS169351 8b8cb71 zadanie z lekcji/15.04, wariant 843.c | true | 200 | 355 | #include <stdio.h>
#include <stdlib.h>
int findMaxElement(int n, int tab[]){
int wynik = tab[0];
for(int i=0;i<n;i++){
if (wynik < tab[i]){
wynik = tab[i];
}
}
return wynik;
}
int main()
{
int tab[] = {111, 3, 56, 2000, 14, 6, 23, 8, 4};
printf("%d", findMa... | 0 |
stevie-ss/alx-low_level_programming | 1d26f51 | 0x02-functions_nested_loops/5-sign.c | C | www.github.com/stevie-ss/alx-low_level_programming/tree/main/0x02-functions_nested_loops/5-sign.c | https://raw.githubusercontent.com/stevie-ss/alx-low_level_programming/1d26f51/0x02-functions_nested_loops/5-sign.c | stevie-ss/alx-low_level_programming 1d26f51 0x02-functions_nested_loops/5-sign.c | true | 200 | 401 | #include "main.h"
/**
* print_sign - prints the sign of a number
* @n: the int to check
* Return: 1 and prints + if n is greater than zero
* 0 and prints 0 if n is zero
* -1 and prints - if n is less than zero
*/
int print_sign(int n)
{
if (n > 0)
{
_putchar('+');
return (1);
}
else if (n == 0)
{
_putchar... | 4 |
osamamuhammad3623/valeo-GP-FOTA | a4b9ea2 | release projects/Master_ECU_Application/Core/Src/uds_client.c | C | www.github.com/osamamuhammad3623/valeo-GP-FOTA/tree/main/release projects/Master_ECU_Application/Core/Src/uds_client.c | https://raw.githubusercontent.com/osamamuhammad3623/valeo-GP-FOTA/a4b9ea2/release%20projects/Master_ECU_Application/Core/Src/uds_client.c | osamamuhammad3623/valeo-GP-FOTA a4b9ea2 release projects/Master_ECU_Application/Core/Src/uds_client.c | true | 200 | 8,678 | /******************************************************************************
*
* Module: UDS_Client
* File Name: uds_client.c
* Description: Source file for the UDS client driver
* Author: Maria Osama, Maram Nabil
*
*******************************************************************************/
#incl... | 2 |
Marinadiva/alx-low_level_programming | 4c79378 | 0x01-variables_if_else_while/5-print_numbers.c | C | www.github.com/Marinadiva/alx-low_level_programming/tree/main/0x01-variables_if_else_while/5-print_numbers.c | https://raw.githubusercontent.com/Marinadiva/alx-low_level_programming/4c79378/0x01-variables_if_else_while/5-print_numbers.c | Marinadiva/alx-low_level_programming 4c79378 0x01-variables_if_else_while/5-print_numbers.c | true | 200 | 317 | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
/**
* main - main block
* Description: prints all single digit numbers of base 10
* starting from 0, followed by a new line.
* Return: 0
*/
int main(void)
{
char c = '0';
while (c <= '9')
{
putchar(c);
c++;
}
putchar('\n');
return (0);
}
| 3 |
obimbasmart/alx-low_level_programming | 0de2578 | 0x13-more_singly_linked_lists/10-delete_nodeint.c | C | www.github.com/obimbasmart/alx-low_level_programming/tree/main/0x13-more_singly_linked_lists/10-delete_nodeint.c | https://raw.githubusercontent.com/obimbasmart/alx-low_level_programming/0de2578/0x13-more_singly_linked_lists/10-delete_nodeint.c | obimbasmart/alx-low_level_programming 0de2578 0x13-more_singly_linked_lists/10-delete_nodeint.c | true | 200 | 1,125 | #include "lists.h"
/**
* delete_nodeint_at_index - delete a node in a LL
* @index: position of node
* @head: pointer to first element of LL
*
* Return: int : 1 or -1
*/
int delete_nodeint_at_index(listint_t **head, unsigned int index)
{
listint_t *next_node;
unsigned int node_len;
node_len = _listint_len(*... | 6 |
Bhanu-Rana3141/Code-in-C | c96a8fe | 7. Arrays/17_duplicateArray.c | C | www.github.com/Bhanu-Rana3141/Code-in-C/tree/main/7. Arrays/17_duplicateArray.c | https://raw.githubusercontent.com/Bhanu-Rana3141/Code-in-C/c96a8fe/7.%20Arrays/17_duplicateArray.c | Bhanu-Rana3141/Code-in-C c96a8fe 7. Arrays/17_duplicateArray.c | true | 200 | 489 | #include<stdio.h>
void duplicate(int arr[],int n){
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
if(arr[i]==arr[j]){
printf("%d is duplicate",arr[i]);
break;
}
}
}
return;
}
int main() {
int n;
printf("Enter n: ");
sc... | 1 |
chrisnobtech/alx-low_level_programming | 31d07c5 | 0x05-pointers_arrays_strings/100-atoi.c | C | www.github.com/chrisnobtech/alx-low_level_programming/tree/main/0x05-pointers_arrays_strings/100-atoi.c | https://raw.githubusercontent.com/chrisnobtech/alx-low_level_programming/31d07c5/0x05-pointers_arrays_strings/100-atoi.c | chrisnobtech/alx-low_level_programming 31d07c5 0x05-pointers_arrays_strings/100-atoi.c | true | 200 | 369 | #include "main.h"
/**
* _atoi - converts a string to an integer
* @s: string to be changed
*
* Return: converted integer
*/
int _atoi(char *s)
{
int sign = 1;
unsigned int num = 0;
do {
if (*s == '-')
sign *= -1;
else if (*s >= '0' && *s <= '9')
num = num * 10 + (*s - '0');
else if (num > 0)
b... | 7 |
sarahsandrade/INF029-SarahAndrade | 665c4fb | .ccls-cache/@home@runner@INF029-SarahAndrade/Codigos_aleatorios@SelectionSort.c | C | www.github.com/sarahsandrade/INF029-SarahAndrade/tree/main/.ccls-cache/@home@runner@INF029-SarahAndrade/Codigos_aleatorios@SelectionSort.c | https://raw.githubusercontent.com/sarahsandrade/INF029-SarahAndrade/665c4fb/.ccls-cache/%40home%40runner%40INF029-SarahAndrade/Codigos_aleatorios%40SelectionSort.c | sarahsandrade/INF029-SarahAndrade 665c4fb .ccls-cache/@home@runner@INF029-SarahAndrade/Codigos_aleatorios@SelectionSort.c | true | 200 | 602 | #include <stdio.h>
#define TAM 10
int main(void) {
int cont,i,j,menor,posicao;
int vetor[TAM];
for(i=0;i<TAM;i++){ //n
printf("Digite o numero da posicao %d: ",i);//n.1
scanf("%d",&vetor[i]);}//n.1
for(i=0;i<TAM-1;i++){// n-1
menor= vetor[i];//(n-1).1
posicao= i;//(n-1).1
for(j=i+1;j<TAM;j... | 0 |
GrozB/Common_core | f1f7517 | minishell/executor.c | C | www.github.com/GrozB/Common_core/tree/main/minishell/executor.c | https://raw.githubusercontent.com/GrozB/Common_core/f1f7517/minishell/executor.c | GrozB/Common_core f1f7517 minishell/executor.c | true | 200 | 4,250 | #include "minishell.h"
#include "builtin.h"
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
extern char **environ;
static size_t ft_strlen(const char *s)
{
size_t i = 0;
while (s[i])
i++;
return (... | 4 |
Ayuxsh01/C_Programming | f3425e6 | output/arrays3.c | C | www.github.com/Ayuxsh01/C_Programming/tree/main/output/arrays3.c | https://raw.githubusercontent.com/Ayuxsh01/C_Programming/f3425e6/output/arrays3.c | Ayuxsh01/C_Programming f3425e6 output/arrays3.c | true | 200 | 682 | #include <stdio.h>
int main()
{
// printf("Hello world/n");
int marks[2][4] = {{45, 234, 2, 3}, {3, 2, 3, 30}};
// for (int i=0 ; i<4 ; i++)
//{
// printf("enter the value of %d element of the array \n", i);
// scanf("%d", &marks);
//}
for (int i = 0; i < 2; i++)
{
for (int ... | 3 |
gaotongfont/GT-HMI-Engine | f4df4a9 | src/widgets/gt_view_pager.c | C | www.github.com/gaotongfont/GT-HMI-Engine/tree/main/src/widgets/gt_view_pager.c | https://raw.githubusercontent.com/gaotongfont/GT-HMI-Engine/f4df4a9/src/widgets/gt_view_pager.c | gaotongfont/GT-HMI-Engine f4df4a9 src/widgets/gt_view_pager.c | true | 200 | 12,604 | /**
* @file gt_view_pager.c
* @author Feyoung
* @brief
* @version 0.1
* @date 2023-10-07 14:39:17
* @copyright Copyright (c) 2014-present, Company Genitop. Co., Ltd.
*/
/* include --------------------------------------------------------------*/
#include "gt_view_pager.h"
#if GT_CFG_ENABLE_VIEW_PAGER
#include "... | 2 |
TashrinTanisha/Switch-Assignments | d0dd6b3 | Switch Case-4.c | C | www.github.com/TashrinTanisha/Switch-Assignments/tree/main/Switch Case-4.c | https://raw.githubusercontent.com/TashrinTanisha/Switch-Assignments/d0dd6b3/Switch%20Case-4.c | TashrinTanisha/Switch-Assignments d0dd6b3 Switch Case-4.c | true | 200 | 781 | #include<stdio.h>
int main()
{
char a = 'C';
//Switch statement
switch(a)//The switch statement starts with the keyword switch followed by the expression to be evaluated
{
case 'A' ://case represents different possible values of the expression
printf("case 'A' works\n");
... | 6 |
Aradhya2708/ICS_Project | 0c5e233 | characters.h | C | www.github.com/Aradhya2708/ICS_Project/tree/main/characters.h | https://raw.githubusercontent.com/Aradhya2708/ICS_Project/0c5e233/characters.h | Aradhya2708/ICS_Project 0c5e233 characters.h | true | 200 | 1,105 | #ifndef CHARACTERS_H
#define CHARACTERS_H
typedef enum
{
SOLDIER,
SHOPKEEPER,
FIGHTER,
CITIZEN,
///Add more as needed
}TypeOfNpc;
typedef struct
{
int HP;
int att;
int def;
int agi;
int str;
int dex;
int inte;
int luck;
}Stats;
typedef struct
{
char* name; /... | 5 |
Hmddev23/alx-low_level_programming | 24763fc | 0x0A-argc_argv/3-mul.c | C | www.github.com/Hmddev23/alx-low_level_programming/tree/main/0x0A-argc_argv/3-mul.c | https://raw.githubusercontent.com/Hmddev23/alx-low_level_programming/24763fc/0x0A-argc_argv/3-mul.c | Hmddev23/alx-low_level_programming 24763fc 0x0A-argc_argv/3-mul.c | true | 200 | 409 | #include "main.h"
/**
* main - Entry point of the program.
*
* @argc: The number of command-line arguments.
* @argv: An array of strings containing the command-line arguments.
*
* Return: Always 0 (success).
*/
int main(int argc, char *argv[])
{
int mul;
if (argc != 3)
{
printf("Error\n");
retur... | 1 |
Amenallah28/holbertonschool-low_level_programming | fd2dcca | static_libraries/6-abs.c | C | www.github.com/Amenallah28/holbertonschool-low_level_programming/tree/main/static_libraries/6-abs.c | https://raw.githubusercontent.com/Amenallah28/holbertonschool-low_level_programming/fd2dcca/static_libraries/6-abs.c | Amenallah28/holbertonschool-low_level_programming fd2dcca static_libraries/6-abs.c | true | 200 | 185 | #include "main.h"
/**
* _abs(int)- a function that computes the absolute value of an integer.
* @n: number
* Return:0
*/
int _abs(int n)
{
if (n < 0)
{
n = n * -1;
}
return (n);
}
| 7 |
trilokeshdas/C | 4ddbc40 | arrays/maxmin.c | C | www.github.com/trilokeshdas/C/tree/main/arrays/maxmin.c | https://raw.githubusercontent.com/trilokeshdas/C/4ddbc40/arrays/maxmin.c | trilokeshdas/C 4ddbc40 arrays/maxmin.c | true | 200 | 401 | #include <stdio.h>
#include <stdlib.h>
int main(){
int i,n;
printf("the size of array");
scanf("%d",&n);
int arr[n];
for(i=0; i<n; i++){
printf("enter the elements");
scanf("%d",&arr[i]);
}
int max= arr[0];
for(i=0; i<5; i++){
if(arr[i]>=max){
max... | 0 |
lilsoul/driver | a74a241 | network/trans/WFPSampler/syslib/HelperFunctions_PendData.h | C | www.github.com/lilsoul/driver/tree/main/network/trans/WFPSampler/syslib/HelperFunctions_PendData.h | https://raw.githubusercontent.com/lilsoul/driver/a74a241/network/trans/WFPSampler/syslib/HelperFunctions_PendData.h | lilsoul/driver a74a241 network/trans/WFPSampler/syslib/HelperFunctions_PendData.h | true | 200 | 3,438 | ////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014 Microsoft Corporation. All Rights Reserved.
//
// Module Name:
// HelperFunctions_PendData.h
//
// Abstract:
// This module contains prototypes for kernel helper functions that ... | 4 |
revit3d/ThirdSemester | 04c83d6 | 04/5.c | C | www.github.com/revit3d/ThirdSemester/tree/main/04/5.c | https://raw.githubusercontent.com/revit3d/ThirdSemester/04c83d6/04/5.c | revit3d/ThirdSemester 04c83d6 04/5.c | true | 200 | 1,125 | #include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int
main (int argc, char *argv[]) {
enum {
READN = sizeof(char),
WRITEN = sizeof(int)
};
if (argc != 4) {
fprintf(stderr, "Wrong number of arguments\n");
return 1;
}
in... | 3 |
Krosikk/sdl3-chess | 896f48a | src/main.c | C | www.github.com/Krosikk/sdl3-chess/tree/main/src/main.c | https://raw.githubusercontent.com/Krosikk/sdl3-chess/896f48a/src/main.c | Krosikk/sdl3-chess 896f48a src/main.c | true | 200 | 3,814 |
/*
* Simple chess game made using SDL3 and SDL_Image
*/
#include <SDL3/SDL_error.h>
#include <SDL3/SDL_init.h>
#include <SDL3/SDL_render.h>
#include <SDL3/SDL_surface.h>
#include <stdint.h>
#include <string.h>
#define SDL_MAIN_USE_CALLBACKS 1 /* use the callbacks instead of main() */
#include <SDL3/SDL.h>
#include... | 2 |
2022-FORZA/CStudy_BaeYeJin | debb0f3 | Lab08_4.c | C | www.github.com/2022-FORZA/CStudy_BaeYeJin/tree/main/Lab08_4.c | https://raw.githubusercontent.com/2022-FORZA/CStudy_BaeYeJin/debb0f3/Lab08_4.c | 2022-FORZA/CStudy_BaeYeJin debb0f3 Lab08_4.c | true | 200 | 871 | //Baekjoon 2776
#include <stdio.h>
#include <stdlib.h>
int compare(const void *a, const void *b){
int n1 = *(int*)a;
int n2 = *(int*)b;
if (n1 < n2) return -1;
if (n1 > n2) return 1;
return 0;
}
int binsearch(int x, int v[], int n){
int low = 0;
int high = n-1;
int mid;
whil... | 6 |
ls-rain/OS | 74a3257 | Scheduling/Kernel/testDefaultScheduling.c | C | www.github.com/ls-rain/OS/tree/main/Scheduling/Kernel/testDefaultScheduling.c | https://raw.githubusercontent.com/ls-rain/OS/74a3257/Scheduling/Kernel/testDefaultScheduling.c | ls-rain/OS 74a3257 Scheduling/Kernel/testDefaultScheduling.c | true | 200 | 2,350 | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <time.h>
#define NUM_PROCESSES 21
#define ARRAY_SIZE 100
int A[ARRAY_SIZE][ARRAY_SIZE];
int B[ARRAY_SIZE][ARRAY_SIZE];
int result[ARRAY_SIZE][ARRAY_SIZE];
void initializeArrays() {
int A[ARRAY_SIZE][AR... | 1 |
Pierrickjay/Minishell_42 | e86bb01 | srcs/srcs_minishell/execution/builtins/ft_export.c | C | www.github.com/Pierrickjay/Minishell_42/tree/main/srcs/srcs_minishell/execution/builtins/ft_export.c | https://raw.githubusercontent.com/Pierrickjay/Minishell_42/e86bb01/srcs/srcs_minishell/execution/builtins/ft_export.c | Pierrickjay/Minishell_42 e86bb01 srcs/srcs_minishell/execution/builtins/ft_export.c | true | 200 | 3,679 | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_export.c :+: :+: :+: ... | 5 |
AkrithiADevadiga/Sprint_MPCC | 68968b6 | MPCC/src/client/receive_messages.c | C | www.github.com/AkrithiADevadiga/Sprint_MPCC/tree/main/MPCC/src/client/receive_messages.c | https://raw.githubusercontent.com/AkrithiADevadiga/Sprint_MPCC/68968b6/MPCC/src/client/receive_messages.c | AkrithiADevadiga/Sprint_MPCC 68968b6 MPCC/src/client/receive_messages.c | true | 200 | 1,192 | void *receive_messages(void *arg) {
int client_socket = *((int *)arg);
free(arg);
logger_init();
logger("INFO", "receive_messages.c", LINE_NUMBER, "Receive messages", "receive_messages", "start");
char buffer[MAX_MSG_LEN+MAX_USERNAME_LEN+1];
char *message;
char *username;
while (1) {
... | 7 |
DonquixoteDonflamingo/Trabalhos-em-C | ae4c741 | macros/1.c | C | www.github.com/DonquixoteDonflamingo/Trabalhos-em-C/tree/main/macros/1.c | https://raw.githubusercontent.com/DonquixoteDonflamingo/Trabalhos-em-C/ae4c741/macros/1.c | DonquixoteDonflamingo/Trabalhos-em-C ae4c741 macros/1.c | true | 200 | 257 | #include <stdio.h>
int verificarNumero(int n)
{
return (n >= 0) ? 1 : 0;
}
int main()
{
int n;
printf("Digite um numero: ");
scanf("%d", &n);
printf("O numero e %s\n", verificarNumero(n) ? "positivo" : "negativo");
return 0;
}
| 0 |
anonymoos01/alx-low_level_programming | 61436af | 0x14-bit_manipulation/1-print_binary.c | C | www.github.com/anonymoos01/alx-low_level_programming/tree/main/0x14-bit_manipulation/1-print_binary.c | https://raw.githubusercontent.com/anonymoos01/alx-low_level_programming/61436af/0x14-bit_manipulation/1-print_binary.c | anonymoos01/alx-low_level_programming 61436af 0x14-bit_manipulation/1-print_binary.c | true | 200 | 321 | #include "main.h"
/**
* print_binary - prints the binary representation of a number.
* @n: the number to print.
*
* Return: (void);
*/
void print_binary(unsigned long int n)
{
unsigned long int r;
if (n == 0)
{
_putchar('0');
return;
}
if (n > 1)
print_binary(n >> 1);
r = n & 1;
_putchar('0' + r);
}... | 4 |
Bojan9/FRI-Programiranje-2-UNI | 712190e | 2023/k2a/n1.c | C | www.github.com/Bojan9/FRI-Programiranje-2-UNI/tree/main/2023/k2a/n1.c | https://raw.githubusercontent.com/Bojan9/FRI-Programiranje-2-UNI/712190e/2023/k2a/n1.c | Bojan9/FRI-Programiranje-2-UNI 712190e 2023/k2a/n1.c | true | 200 | 503 | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
int main(int argc, char** argv) {
FILE* in = fopen(argv[1], "r");
FILE* out = fopen(argv[2], "w");
int pred = fgetc(in);
int c;
while ((c = fgetc(in)) != EOF) {
if (!(pred == '"' && (c == 'C' || c == 'c' || c ... | 3 |
nani82096/CandLinux | 25c9d7a | Assignments/Data_structures/Trees/BST/source/BST.c | C | www.github.com/nani82096/CandLinux/tree/main/Assignments/Data_structures/Trees/BST/source/BST.c | https://raw.githubusercontent.com/nani82096/CandLinux/25c9d7a/Assignments/Data_structures/Trees/BST/source/BST.c | nani82096/CandLinux 25c9d7a Assignments/Data_structures/Trees/BST/source/BST.c | true | 200 | 1,340 | #include "header.h"
/* main function*/
int main(void)
{
int choice;
NODE *root = NULL;
int value;
while (1) {
printf("\n\n---------------MENU-------------\n"
"1.Insert Into Tree\n"
"2.Traverse in Preorder\n"
"3.Traverse in Inorder\n"
"4.Traverse in Postorder\n"
"5.Delete\n"
"6.Level Ord... | 2 |
CodeSlayer123/holbertonschool-low_level_programming | 97a6152 | 0x0B-malloc_free/3-alloc_grid.c | C | www.github.com/CodeSlayer123/holbertonschool-low_level_programming/tree/main/0x0B-malloc_free/3-alloc_grid.c | https://raw.githubusercontent.com/CodeSlayer123/holbertonschool-low_level_programming/97a6152/0x0B-malloc_free/3-alloc_grid.c | CodeSlayer123/holbertonschool-low_level_programming 97a6152 0x0B-malloc_free/3-alloc_grid.c | true | 200 | 750 | #include "main.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**
* alloc_grid - returns pointer to a 2 dimensional array of ints
* @width: width
* @height: height
* Return: pointer to array, NULL if it fails
*/
int **alloc_grid(int width, int height)
{
int **a;
int i;
int j;
if (width == 0)
... | 6 |
niloychandrasarker/CS-Fundamentals- | 5ec0b6e | 01.Introduction to Programming Language & Problem Solving Part-I/Weak 02-Loop Recap and Array/Module 06.5-weak 02 practice day 01/pp_01-C_Next_Alphabet_codeporces.c | C | www.github.com/niloychandrasarker/CS-Fundamentals-/tree/main/01.Introduction to Programming Language & Problem Solving Part-I/Weak 02-Loop Recap and Array/Module 06.5-weak 02 practice day 01/pp_01-C_Next_Alphabet_codeporces.c | https://raw.githubusercontent.com/niloychandrasarker/CS-Fundamentals-/5ec0b6e/01.Introduction%20to%20Programming%20Language%20%26%20Problem%20Solving%20Part-I/Weak%2002-Loop%20Recap%20and%20Array/Module%2006.5-weak%2002%20practice%20day%2001/pp_01-C_Next_Alphabet_codeporces.c | niloychandrasarker/CS-Fundamentals- 5ec0b6e 01.Introduction to Programming Language & Problem Solving Part-I/Weak 02-Loop Recap and Array/Module 06.5-weak 02 practice day 01/pp_01-C_Next_Alphabet_codeporces.c | true | 200 | 234 | //codeforces problem :: C. Next Alphabet
#include <stdio.h>
int main()
{
char c,next_char;
scanf("%c", &c);
if(c==122)
{
printf("a\n");
}
else
{
printf("%c\n",c + 1);
}
return 0;
}
| 5 |
ShreyB2091/Operating-Systems | 3435326 | Assignment 3/gemOS/src/user/part3/testcase5.c | C | www.github.com/ShreyB2091/Operating-Systems/tree/main/Assignment 3/gemOS/src/user/part3/testcase5.c | https://raw.githubusercontent.com/ShreyB2091/Operating-Systems/3435326/Assignment%203/gemOS/src/user/part3/testcase5.c | ShreyB2091/Operating-Systems 3435326 Assignment 3/gemOS/src/user/part3/testcase5.c | true | 200 | 1,207 | #include<ulib.h>
/*simple cfork testcase */
int main(u64 arg1, u64 arg2, u64 arg3, u64 arg4, u64 arg5)
{
long pid;
long *va = (long *)expand(100,MM_WR);
*va = 10;
printf("Main number:%d\n", *va);
long cow_fault;
pid = cfork();
long pid2 = cfork();
if(pid){
if(!pid2){
sleep(30)... | 1 |
mutsolgov/C2_s21_stringplus-1 | 4251c23 | src/s21_trim_test.c | C | www.github.com/mutsolgov/C2_s21_stringplus-1/tree/main/src/s21_trim_test.c | https://raw.githubusercontent.com/mutsolgov/C2_s21_stringplus-1/4251c23/src/s21_trim_test.c | mutsolgov/C2_s21_stringplus-1 4251c23 src/s21_trim_test.c | true | 200 | 2,806 | #include <check.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "s21_string.h"
Suite *s21_trim_suite(void);
int s21_trim_test(void);
int main(void) {
int count_failed = s21_trim_test();
if (count_failed > 0) {
printf("====================\n");
printf("Tests failed: %d\n", count_fai... | 0 |
sgwc/alx-low_level_programming | 2f2dbac | 0x06-pointers_arrays_strings/4-rev_array.c | C | www.github.com/sgwc/alx-low_level_programming/tree/main/0x06-pointers_arrays_strings/4-rev_array.c | https://raw.githubusercontent.com/sgwc/alx-low_level_programming/2f2dbac/0x06-pointers_arrays_strings/4-rev_array.c | sgwc/alx-low_level_programming 2f2dbac 0x06-pointers_arrays_strings/4-rev_array.c | true | 200 | 317 | #include "main.h"
/**
* reverse_array - reverse the array elements
* @a: array of integers
* @n: the number of elements to be swaped
*
* Return: nothing
*/
void reverse_array(int *a, int n)
{
int i;
int temp;
for (i = 0; i < n / 2; i++)
{
temp = a[i];
a[i] = a[n - i - 1];
a[n - i - 1] = temp;
}
}
| 7 |
lufucx/c-fundamentals-course | 753d8d2 | cap05/exercicio5.6.c | C | www.github.com/lufucx/c-fundamentals-course/tree/main/cap05/exercicio5.6.c | https://raw.githubusercontent.com/lufucx/c-fundamentals-course/753d8d2/cap05/exercicio5.6.c | lufucx/c-fundamentals-course 753d8d2 cap05/exercicio5.6.c | true | 200 | 774 | #include <stdio.h>
#include <stdlib.h>
int main (void) {
int array[2][3];
int arrayMt[3][2];
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
printf("array[%d][%d]: ", i, j);
scanf("%d", &array[i][j]);
}
}
printf("\nM:\n");
for (int i = 0; i ... | 4 |
ibramady22/Tasks-Tricks_of_embedded_systems | 5a4be0c | HAL/Sensors.c | C | www.github.com/ibramady22/Tasks-Tricks_of_embedded_systems/tree/main/HAL/Sensors.c | https://raw.githubusercontent.com/ibramady22/Tasks-Tricks_of_embedded_systems/5a4be0c/HAL/Sensors.c | ibramady22/Tasks-Tricks_of_embedded_systems 5a4be0c HAL/Sensors.c | true | 200 | 835 | #include "Sensors.h"
/**** (RS/RO *100) FOR (H2,LPG,ch4,CO,ALCHOL) in this order at(30% and 50%)***/
static const u16 RS_RO[5][2]={{78,72},{24,19},{35,28},{260,250},{205,190}};
u16 TEMP_Read(void)
{
u16 volt=ADC_GetVolt(LM35_CH);
u16 temp=volt;
return temp;
}
u16 TEMP2_Read(void)
{
u16 adc=ADC_Read(POT_CH)... | 2 |
SLW1n1ng/SinglyLinkedList_C | 83e5221 | LnkdLstBasics/addNewNodeAfterSpecificElementInList.c | C | www.github.com/SLW1n1ng/SinglyLinkedList_C/tree/main/LnkdLstBasics/addNewNodeAfterSpecificElementInList.c | https://raw.githubusercontent.com/SLW1n1ng/SinglyLinkedList_C/83e5221/LnkdLstBasics/addNewNodeAfterSpecificElementInList.c | SLW1n1ng/SinglyLinkedList_C 83e5221 LnkdLstBasics/addNewNodeAfterSpecificElementInList.c | true | 200 | 816 | #include "addNewNodeAfterSpecificElementInList.h"
#include <stdio.h>
#include <stdlib.h>
#include "node.h"
void addNewNodeAfterSpecificElementInList(struct Node** head, int specificElement, int newData) {
if (specificElement < 1) {
printf("%*sNode %d not found in the list.\n\n", 5, "", specificElement);
return;
... | 6 |
Domszym/File-contents-to-uppercase | 4784274 | Source.c | C | www.github.com/Domszym/File-contents-to-uppercase/tree/main/Source.c | https://raw.githubusercontent.com/Domszym/File-contents-to-uppercase/4784274/Source.c | Domszym/File-contents-to-uppercase 4784274 Source.c | true | 200 | 1,896 | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#define ONE 1
#define TWO 2
#define THREE 3
//Dominic Szymanski - January 18th, 2024
//This program will take a file, make a copy of it, and then convert all characters within the original file to
//uppercase within th... | 5 |
josedihego/ADS-ALG-C | bd95ee9 | pointers/chapter2/pointers_structs.c | C | www.github.com/josedihego/ADS-ALG-C/tree/main/pointers/chapter2/pointers_structs.c | https://raw.githubusercontent.com/josedihego/ADS-ALG-C/bd95ee9/pointers/chapter2/pointers_structs.c | josedihego/ADS-ALG-C bd95ee9 pointers/chapter2/pointers_structs.c | true | 200 | 1,004 | #include<stdio.h>
#include<stdlib.h>
typedef struct Funcionario{
char * nome;
char * CPF;
int idade;
float salario;
} Funcionario;
typedef struct Empresa{
char * CNPJ;
Funcionario ** funcionarios;
//Funcionario * funcionarios [];
int max;
int atual;
} Empresa;
void adicionar_funci... | 3 |
ykuze/LhaZero | d66d199 | src/maketree.c | C | www.github.com/ykuze/LhaZero/tree/main/src/maketree.c | https://raw.githubusercontent.com/ykuze/LhaZero/d66d199/src/maketree.c | ykuze/LhaZero d66d199 src/maketree.c | true | 200 | 4,079 | /* ------------------------------------------------------------------------ */
/* LHa for UNIX */
/* maketree.c -- make Huffman tree */
/* */
/* Modified Nobutaka Watazaki */
/* */
/* Ver. 1.14 Source All chagned 1995.01.14 N.Wa... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.