language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | /*
Dynamic Queue
*/
#pragma once
//#define kDefaultDataBufferSize (100*1024)
//#define kDefaultSizeBufferSize (100*8)
typedef void * queuePtr;
/********************************************
to create a new queue
returns a pointer to an allocated queue
or NULL if can't allocate memory
*/
queuePtr
queueCre... |
C | #include<stdio.h>
struct info
{
int id_no;
char name[20];
char addr[20];
int age;
};
struct info std[50];
void main()
{
int i,n;
printf("Enter the Number of Student:");
scanf("%d", &n);
//printf("Enter ID,NAME,ADDRESS and AGE:");
for(i=0;i<n;i++)
{
printf("Now Enter stu... |
C | #include <stdio.h>
extern void writescr(int ,int, char *);
extern void pmWriteScr(int,int,char *);
void clearscreen(int);
void writeln(char *);
extern void gdt_flush(int,int ,int ,int ,int,int);
extern void schedule();
void enqueue();
void pmWriteln(int,int);
void createProcess(unsigned int ,unsigned int, unsigned... |
C | #include <stdio.h>
main(argc, argv)
int argc;
char *argv[];
{
char c;
while ((c = getchar()) != EOF) {
if (c == '`') {
processParam(argc, argv);
} else {
if (c == '\\') {
c = getchar();
if (c != '`')
putchar('\\');
}
putchar(c);
}
}
}
processParam(argc, argv)
int argc;
cha... |
C | //Nick Vilimek
#include <stdio.h>
#include <string.h>
int main ( int argc, char* argv[] ){
char* cmd;
char buffer[200];
char* strippedNewline;
fgets(buffer,200,stdin);
strippedNewline = strtok(buffer,"\n");
while(cmd != NULL){
printf("%s\n", cmd);
cmd = strtok(NULL,",");
}
/*
int ma... |
C | #include "chat_client.h"
int setUpUDPServer(int *socketd,struct sockaddr_in *address_info, int port) {
if ( (*socketd = socket(AF_INET, SOCK_DGRAM, 0))==-1 ) {//socket client gia epikoinonia me ton allo client
printf("\nSocket creation failure %d\n",errno); //
perror("Socket");
return 1;
}
/*
... |
C | #include "ocilib.h"
/* requires script demo/number.sql */
void err_handler(OCI_Error *err)
{
printf("%s\n", OCI_ErrorGetString(err));
}
int main(void)
{
OCI_Connection *cn = NULL;
OCI_Statement *st = NULL;
OCI_Resultset *rs = NULL;
OCI_TypeInfo *tc = NULL;
OCI_TypeInfo *to = NULL;
O... |
C | #include "a4.h"
#include <stdio.h>
#include <stdlib.h>
PPM_IMAGE *read_ppm(const char *file_name){
FILE *read_file;
read_file = fopen(file_name, "r");
unsigned char a,b;
int w, h, m_color;
int red, green, blue;
fscanf(read_file, "%c%c", &a, &b);
fscanf(read_file, "%d", &w);
fscanf(read_... |
C | #include<stdio.h>
int main()
{
int n,i,f,s,d;
printf("Enter howmany rows:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %d",&f,&s);
printf("%d\t%d\n",f,s);
d=f-s;
printf("difference is %d",d);
}
return 0;
}
|
C | /********************************************************************************
* File: misc.c
* Date: 2002-09-24
* Author: Alain Girardet/Dominik Blunk
* Last Modified: 2002-10-24
*
* Description: Misc functions
*
*
* This program is free software; you can redistribute it and/or modify it under
* the terms... |
C | //
// stringFuncs.c
// pdbParse
//
// Created by mkaya on 26/07/2017.
// Copyright © 2017 mkaya. All rights reserved.
//
#include "stringFuncs.h"
char *getString(char *string,int baslangic, int bitis){
char *parca = (char*)malloc(bitis+1-baslangic*sizeof(char));
int i;
int a = 0;
for(i = baslangic-... |
C | #include <stdio.h>
main()
{
int c;
int l=0;
int cl=0;
int ln=0;
int cln=0;
while (EOF != (c=getchar()))
{
if ('\n' == c)
{
cln++;
if (cl > l) {l=cl; ln=cln;}
cl=0;
}
cl++;
}
printf("%d\n", l);
printf("%d\n", ln);
}
|
C | /*
*Hector Jesus De La Garza Ponce 619971
*Oziel Alonzo Garza Lopez 805074
*Libreria pila.c
*/
#include <stdio.h>
#include <stdlib.h>
#include "pilas.h"
/*
* Función: push
* Parámetros: pila *x, void* dato
* Descripción: Funcion encargada de agregar un valor desconocido a una pila, el valor desconocido solo sera... |
C | inherit SKILL;
void setup() {
set("name","廨");
set("type","herb");
set("effective_level",200);
set("usage/herb",1);
set("difficulty",200);
set("skill_class","knight");
}
int valid_learn(object me)
{
if( me->query_skill("herb", 1) < me->query_skill("dream-herb",1)) {
return notify_fail("ҩķ㣬廨\n");
}
return... |
C | /* DO NOT MODIFY | NE MODIFIEZ PAS */
#ifndef STUDENT_H_
#define STUDENT_H_
#include "support.h"
#define PI 3.14159265
#define WIDTH 3
#define GREYSCALE " .:-=+*#%@";
#define IMG_SIZE 42
// Question 1
float calculator(int choice, float a, float b);
// Question 2
double deg_to_rad(double deg);
double power(double x... |
C | //Ray Allan Foote
//footer@onid.orst.edu
//CS311_400
//Assignment 6 (pthreads)
#define _BSD_SOURCE
#include <limits.h>
#include <sys/types.h>
#include <fcntl.h>
#include <getopt.h>
#include <pthread.h>
#include <stdio.h>
#include <sys/times.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
static pthread_... |
C | #include <stdio.h>
#include "ece454rpc_types.h"
int ret_int;
return_type r;
return_type add( const int nparams, arg_type* a )
{
printf("Entered the add function.\n");
if( nparams != 2 )
{
/* Error! */
r.return_val = NULL;
r.return_size = 0;
return r;
}
if( a->... |
C | #include<stdio.h>
#include<stdlib.h>
struct node
{
int coef;
int exp;
struct node *link;
};
void input_LL(struct node **,int,int);
void display(struct node *);
void addition(struct node **,struct node **,struct node **);
void product(struct node **,struct node **,struct node **);
void main()
{
struct node *start_p=... |
C | #include "pool.h"
#include "functions.h"
#include "iterators.h"
int data[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int fibonacci(int n){
if(n == 0 || n == 1){
return 1;
}
else {
return fibonacci(n - 1) + fibonacci(n - 2);
}
}
Value fib(Value* val){
int n = val[0].asInt;
return asInt(fibonacci(n));
}
void print(... |
C | #ifndef LIST_H
#define LIST_H
#include <stdlib.h>
struct node {
int val;
struct node *next;
}typedef node;
struct list {
struct node *head;
struct node *tail;
}typedef list;
void init(struct list *); //initialize empty list
int size(struct list *); //return number of nodes in list
void print(struct li... |
C | #include "holberton.h"
#include <stdio.h>
#include <stdlib.h>
/**
* alloc_grid - allocates memory for a simulation of a 2D array
* @width: The amount of columns in the grid
* @height: The amount of rows
* Return: The double array pointing to the grid
*/
int **alloc_grid(int width, int height)
{
int **array... |
C | #include<stdio.h>
#include<string.h>
void main()
{
int i,j,m,n,item,loc=0,loc1=0,f=0;
int a[20][20];
printf("\nEnter size of the array\n");
scanf("%d%d",&m,&n);
printf("\n\tEnter The Value Of Array:");
for(i=1;i<=m;i++)
{
for(j=1;j<=n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n\tEnter The Value To Be Serched:");
scanf(... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "math.h"
#include <stdbool.h>
static void spaceToStr(int num) {
if (num > 0) {
for (int i = 1; i <= num; i++) {
printf(" ");
}
}
}
static void starToStr(int num) {
if (num > 0) {
for (int i = 1; i <= num; i++) {
printf("*");
}
pri... |
C | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct ListNode* swapPairs(struct ListNode* head) {
if (head == NULL || head->next == NULL) return head;
struct ListNode* listNode = head->next;
head->next = swapPairs(listNode->next);
... |
C |
/* ************************************ */
/* */
/* vc_stock.c */
/* */
/* By: Emre E, Javier, Minami */
/* */
/* ************************************ */
#include <stdlib.... |
C | #ifndef FILE_OPERATIONS_H
#define FILE_OPERATIONS_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include "../include/global.h"
char* buildFullPath(char* pathToFile, char* fileName); // Returns a string like this: pathToFile\fileName
int copyBytes(FIL... |
C | #include<stdio.h>
int main()
{
int feet,inch;
printf("enter the value of feet");
scanf("%d",&feet);
inch=feet*12;
printf("total inches will be:%d\n", inch);
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/random.h>
#include "define_macro_functions.h"
#include "define_macros.h"
#include "structures.h"
#include "convert.h"
#include "vrf.h"
#include "crypto_vrf.h"
#include "VRF_functions.h"
/*
-------------------------------------------------------... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_btree_repare.c :+: :+: :+: ... |
C | #include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "graph_utils.h"
#include "fifo.h" /* for taboo list */
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
#include <fcntl.h>
#include "connect.h"
#define MAXSIZE (541)
#define ... |
C | #include <stdio.h>
int main(void){
int num;
printf("10 ԷϽÿ \n");
scanf("%d",&num);
printf("10 : %d | 16 %x \n", num,num);
return 0;
}
|
C | /*Programa: Torres de Hanoi
Autor: Sergi Planes
Data: 16/06/201
Funcionalitat: Estructura de dades del programa */
//llibrerias
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
//Constants utilitzades.
#define NUMDISCOS 3 //Especifica el nombre de discs
#define NUMTORRES 3 //Indica el ... |
C | #include "memory.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Memory* memCreate() {
int i;
Memory* mem = (Memory*)malloc(sizeof(Memory));
memset(mem->ramFlag, 0x00, 0x400000);
memset(mem->romFlag, 0x00, 0x80000);
mem->romMask = 0x03;
for (i = 0; i < 32; i++) {
mem->rom[i].type = MEM_ROM;
me... |
C | /* Author: Lauren Sampaio
* File: matrix_product.c
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <sys/wait.h>
#include <pthread.h>
#include "matrix_product.h"
int step = 0;
/* Essayer de faire avec fork, et comparer avec le multithread */
double * alloc_matrix( int rows,... |
C | #include <stdio.h>
int main(){
int nbtetes,coup;
nbtetes=8542;
coup = 0 ;
while ( nbtetes > 1 ) {
nbtetes=nbtetes/2;
coup++ ;
printf("%d -> %d \n", coup, nbtetes ) ;
if(((nbtetes%2)!=0)&&(nbtetes!=1)) {
nbtetes=(nbtetes*3)+1;
}
}
/* ... |
C | #include "header.h"
#include <stdio.h>
char *AnotherString = "Hello Everyone";
main()
{
printf("Running...\n");
/*
* Call WriteMyString() - defined in another file
*/
WriteMyString(MY_STRING);
printf("Finished.\n");
}
|
C | #include "line.h"
#include <math.h>
//draw_line
//draw_line <channel>,<x1>,<y1>,<x2>,<y2>,<width>,<color>
void draw_line(thread_context* context, char* args) {
int channel = 0, color = COLOR_TRANSPARENT, height = 0;
double x1 = 0, y1 = 0, x2 = 0, y2 = 0, width = 0;
bool color_empty = true;
args = read_... |
C | /**
* File contains a example test program for the generic Hash map implemented
*
* The Output of the program looks like:
* Inserting : ONE
* 0 ---> size = 0 ||
* 1 ---> size = 1 || ONE |
*
* Inserting : TWO
* 0 ---> size = 0 ||
* 1 ---> size = 2 || ONE | TWO |
*
* Inserting : THREE
* 0 ---> size... |
C | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int fibo(int n){
if((n==0) ||(n==1)){
return n;
}else{
return fibo(n-1)+fibo(n-2);
}
}
main(void){
setlocale(LC_ALL, "portuguese");
int a,i;
printf("Digite ate quantos numeros voc quer:");
scanf("%d",&a);
for(i = 0; i <= a; i++){
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "circular_double_linked_list.h"
int main()
{
struct Node *list1 = NULL;
while (1)
{
char *command;
int i1, i2, i3, i4;
scanf("%s", command);
scanf("%d", &i1);
scanf("%d", &i2);
printf("%s %d", command, i2);
if (strcmp(command,... |
C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main() {
char s[100];
gets(s);
int i=0, j=0, k=0, dom=0, flag=0;
int l = strlen(s);
while(s[i]!='@' && i<l) {
if(s[i]>=97 && s[i]<=122 || s[i]>=48 && s[i]<=57 || s[i]=='_') {
if(k>10){
printf("Id too long!");
flag=1;
exit(1... |
C |
#include "bstitr.h"
#include "../bstitrpreord.h"
#include "../bstitrinord.h"
#include "../bstitrpostord.h"
#include "../bstitrbreadth.h"
#include "adt/adt.h"
#include "adt/ptr/adtptr.h"
/* ************************************************************************** */
BSTType* ConstructBSTIterative()
{
BSTType* typ... |
C |
// MT, 2016mar01
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include "Obj.h"
#include "Str.h"
char* Str_from_long_create(long const inVal)
{
char* retVal = NULL;
char const * const formatStr = "%ld";
char dummy[] = { '\0' };
int const strLen = snprintf(dummy, sizeo... |
C | #include <stdio.h>
void add(int * array)
{
array[3]=array[0]+array[1]+array[2];
printf("\nthe sum is %d",array[3]);
}
int main(void)
{
int array[4],i;
void add(int *);
printf("enter the three numbers");
for(i=0;i<3;i++)
{
scanf("%d",&array[i]);
}
add(array);
return 0;
}
|
C | /*
* Copyright 2021 The CFU-Playground Authors
*
* 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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... |
C | #include <stdio.h>
#include <stdlib.h>
int main() {
int *arr = malloc(sizeof(int) * 5);
volatile int i;
int sum = 0;
for (i = 0; i < 5; i++) {
arr[i] = i;
}
for (i = 0; i < 5; i++) {
sum += arr[i];
}
free(arr);
return sum;
}
|
C | #define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <sys/unistd.h>
#include <sys/signal.h>
#include <string.h>
#include <pwd.h>
#include <time.h>
#include <sys/types.h>
int usr1_caught = 0;
int sigs_to_send;
pid_t catcher_pid;
typedef enum sig_mode {
KILL, QUEUE, RT, UNDEFINED
} sig_m... |
C | /* A simple server in the internet domain using TCP
The port number is passed as an argument */
#include "sls_detector_defs.h"
#include "slsDetectorServer_defs.h"
#include "communication_funcs.h"
#include "slsDetectorServer_funcs.h"
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
e... |
C | #include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include <pwd.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
void print_lstat(const char* );
void if_dir(DIR* );
void display_file_type(int );
void display_permisions(int );
char* formatdate(char*, tim... |
C | #include <stdio.h>
void print_array(int array[], int num)
{
int i;
for (i = 0; i < num; i++)
{
printf("%d ", array[i]);
}
printf("\n");
return;
}
void express(int a[][2], int express_node[], int num)
{
int i, k;
for (i = 0; i < num; i++)
{
k = a[i][1];
express_node[k] = a[i... |
C | //
// binary.c
//
//
// Created by Adenike Adeyemi on 5/18/17.
//
//
#include <stdio.h>
int main(){
FILE *fp;
fp = fopen("test4.bin", "wb");
if(!fp){
printf("Unable to open\n");
return 1;
}
// char x[10]="ABCDEFGHIJ";
//void function1()
//int function2()
//int ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_free_utility.c :+: :+: :+: ... |
C | //
// LSUtils.h
// LockScreen
//
// Copyright (c) 2014 SquareCodeCamp. All rights reserved.
//
#ifndef LockScreen_LSUtils_h
#define LockScreen_LSUtils_h
typedef enum {
LSDirectionUndefined = -1,
LSDirectionUp = 0,
LSDirectionDown,
}LSDirection;
LSDirection directionBetweenPoints(CGPoint pointA, CGPoin... |
C | #ifndef TB_ARRAY_H
#define TB_ARRAY_H
#include <stdlib.h>
#define TB_ARRAY_HDR_ELEM size_t
#define TB_ARRAY_HDR_SIZE 2 * sizeof(TB_ARRAY_HDR_ELEM)
#define tb_array__hdr(b) ((size_t*)(void*)(b) - 2)
#define tb_array__cap(b) tb_array__hdr(b)[0]
#define tb_array__len(b) tb_array__hdr(b)[1]
#define tb_array_len(b) ((b)... |
C | #include "queue.h"
#include "queueTest.h"
#include <stdlib.h>
#include <stdio.h>
bool queueTest(void)
{
bool result = true;
Queue* queue = initQueue();
enqueue(queue, 5);
if (empty(queue))
{
result = false;
printf(" 1 \n");
}
if (dequeue(queue) != 5)
{
printf(" 2 \n");
}
if (!empty(queue))
{
result ... |
C | #include "environment.h"
#include <stdio.h>
#include <errno.h>
#define DETECT_DEVICE_ERROR(dev_fd, DEVICE) \
if (dev_fd < 0) { \
printf("Device open error : %s\n", DEVICE); \
exit(1); \
}
// construct_environment must be called by main function
// when program begins
void
construct_environment(struct environm... |
C | /*
** my_str_to_wordtab_double.c for mysh in /home/sachs_a/delivery/system_unix/
**
** Made by Alexandre Sachs
** Login <sachs_a@epitech.net>
**
** Started on Wed Mar 15 10:59:39 2017 Alexandre Sachs
** Last update Mon Apr 3 20:45:16 2017 Alexandre Sachs
*/
#include <stdlib.h>
#include "basics.h"
int separators... |
C | #include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <stdlib.h>
static void sighandler(int signo){
if (signo == SIGUSR1){
printf("My Parent PID: %d \n", getppid());
}
if (signo == SIGINT){
int crash = open("status.txt", O_CREAT|O_RDWR, 0777);
i... |
C | #include<stdio.h>
#include<math.h>
int notIn(float x,float y,int r)
{
if((x+2)*(x+2)+(y-2)*(y-2)<=r*r)return 0;
if((x-2)*(x-2)+(y-2)*(y-2)<=r*r)return 0;
if((x+2)*(x+2)+(y+2)*(y+2)<=r*r)return 0;
if((x-2)*(x-2)+(y+2)*(y+2)<=r*r)return 0;
return 1;
}
int main(int argc,char **argv)
{
p... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_extra_functions_3.c :+: :+: :+: ... |
C | #include"book.h"
Book *head = NULL;
int nbook = 0;
int choice(){
while(1){
system("clear");
int m;
printf("\n*************************欢迎使用图书管理系统*************************\n\n");
printf("请输入项目前编号执行相关操作:\n\n");
printf("[1] 查看图书\n[2] 添加新图书\n[3] 修改图书信息\n[4] 删除图书\n");
printf("[0] 退出系... |
C | #include<stdio.h>
#include<stdlib.h>
#include"stack.h"
void StackInit(Stack* pstack)
{
pstack->topIndex = -1;
}
int SIsEmpty(Stack* pstack)
{
if(pstack->topIndex==-1)
return TRUE;
else return FALSE;
}
void SPush(Stack* pstack , Data data)
{
pstack->topIndex += 1;
pstack->stack[pstack->topIndex] = data;
}
Da... |
C | /* Copyright 2013-2015 Drew Thoreson
*
* This file is part of Telos.
*
* Telos is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 2 of the License.
*
* Telos is distributed in the hope tha... |
C | /*
*******************************************************************************
\file ww.h
\brief Arbitrary length words
\project bee2 [cryptographic library]
\created 2012.04.18
\version 2023.02.02
\copyright The Bee2 authors
\license Licensed under the Apache License, Version 2.0 (see LICENSE.txt).
***************... |
C | #include <stdio.h>
#include <string.h>
/**
*/
int main()
{
char str1[50];
char str2[20];
printf("Ŀַ");
gets(str1);
printf("Դַ");
gets(str2);
strcpy(str1,str2);
printf("***ƺ***\n");
printf("Ŀַ%s\n",str1);
printf("Դַ%s\n",str2);
return 0;
}
|
C | #include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#define QTY_EMPLEADOS 10
#define QTY_NOMBRES 5
#define QTY_CARACTERES 50
#define STATUS_EMPTY 0
#define STATUS_NOT_EMPTY 1
struct sEmpleado
{
//********* OBLIGATORIOS
int idEmpleado;
int status;
//********* DATOS
char nombre[50];
... |
C | #include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <sys/time.h>
#include <assert.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
#include <assert.h>
#include <sys/wait.h>
void demo();
struct test{
cha... |
C | #include <stdio.h>
#include <time.h>
#include <pthread.h>
#include <string.h>
#include <immintrin.h>
#include <stdint.h>
#include <stdbool.h>
#define ITERATIONS 1000000000
#define EXEC_TIME 100
#define BILLION 1000000000L
#define INSTR 9
#define FILE_SIZE 10737418240 //10GB
#define EXP_DURATION 10 //20s
int *thread... |
C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int score;
int star[5] = { 0 };
printf(" Է : ");
int max = 0;
int min = 100; //0~100 Էϴ ̱
while (1)
{
scanf("%d", &score);
if (score < 0) break;
switch (score/10)
{
case 10:case 9: star[0]++; break;
case 8: star[1]++; break;
case... |
C | /*!
* MPT solver module helper function
* set IVP equotation count and grid size/data
*/
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <sys/uio.h>
#include "meta.h"
#include "../solver.h"
extern int mpt_solver_module_value_ivp(MPT_STRUCT(value) *val, const MPT_IVP_STRUCT(parameters) *pa... |
C | #include<stdio.h>
int main()
{
int x,y,sum=0,i,j;
scanf("%d %d",&x,&y);
j=(x*(x+1))/2;
//if(j<=y){
for(i=1;;i++)
{
sum+=i;
if(sum==y)
{
printf("0");
return 0;
}
else if(sum>y)
{
printf("%d",y-(sum-i));
... |
C | /**************************************************************************
Module: rms_rec_arch_command.c
Description: This module is to setup an RDA control command
to start or stop archive II recording.
Assumptions:
**************************************************************************/
/*
... |
C | #include <stddef.h>
#include <stdbool.h>
#include "set.h"
Set set_singleton(size_t i) {
return 1lu<<i;
}
bool set_has(Set S, size_t i) {
return (S & (1lu<<i)) != 0;
}
Set set_include(Set S, size_t i) {
return S | (1lu<<i);
}
Set set_exclude(Set S, size_t i) {
return S & ~(1lu<<i);
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <term.h>
#include <ncurses.h>
/*
Compile this with -lncurses
*/
int main(void){
char *bold, *offbold;
setupterm(NULL, fileno(stdout), (int *)0);
bold = tigetstr("smso");
offbold = tigetstr("rmso");
putp(bold);
printf("This should be highlighted\n");
putp(offbold);... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define _CRT_SECURE_NO_WARNINGS
void main()
{
int Weight, Height;
float BMI;
printf("Please enter weight (in kg) and height (in cm), respectively: ");
scanf("%d%d", &Weight, &Height);
BMI = (double)Weight/powf((double)Height/100,2);
if(BM... |
C | /**
* This class currently computes the axis on which consecutive acceleration vectors are turning.
*/
#include "rotation_axis.h"
void initialise_rotation_axis(RotationAxis *axis_and_angle_buffer) {
axis_and_angle_buffer->is_current_axis_valid = false;
axis_and_angle_buffer->is_previous_accel_data_valid = fa... |
C |
#include "trap.h"
void
pic_eoi(uint8_t irq)
{
if (irq >= 8)
{
outb(PIC2_CMD, PIC_EOI);
}
outb(PIC1_CMD, PIC_EOI);
}
Interrupt_gate idt[256];
extern uint32_t vectors_array[];
void
init_interrupt_gate_entry(Interrupt_gate *entry, uint32_t offset, uint16_t selector)
{
entry->offset_0_15 ... |
C | #include<stdio.h>
/*
Study of Division Operators
C provides 2 division operators
1) / (Divide)
It gives the quotient of division
2) % (Modulus)
It gives the remainder of division.
It works on whole numbers only.
*/
int main()
{
int q, r;
q = 15/7;
r = 15%7;
printf("15 divided by 7")... |
C | #ifndef _QUEUE_H_
#define _QUEUE_H_
#define QueueMax 10
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef int QUDataType;
typedef struct Queue
{
QUDataType _data[QueueMax];
QUDataType* _front; // ͷ
QUDataType* _rear; // β
size_t size;
}Queue;
void QueueInit(Queue* pq);
void QueueDestory(Queue*... |
C | //memlayout.c
#include <stdio.h>
#include <stdlib.h>
// Stored in data segment
int initialized_global = 0x1234;
// Stored in bss segment
int uninitialized_global;
void main()
{
// Stored on stack
int stack_variable = 0x5678;
// Stored on heap
int* heap_variable = (int*) malloc(sizeof(int));
*he... |
C | #include<stdio.h>
int fpb(int d,int e){
if(d==0)return e;
else{return fpb(e%d,d);}
}
int main(){
int a,b;
printf("Program Mencari Faktor Persekutuan Terbesar\n"
"Silahkan masukkan Angka Pertama> ");
scanf("%d",&a);
printf("Silahkan masukkan Angka Kedua> ");
scanf("... |
C | /*
Given an array of characters print the characters that have ‘n’ number of occurrences.
If a character appears consecutively it is counted as 1 occurrence
*/
// Below version code different from zoho question
// code question : https://practice.geeksforgeeks.org/problems/remaining-string/0
#include <stdio.h>
int ... |
C | #include <stdlib.h>
struct s_node {
void *content;
struct s_node *next;
};
void *intersection(struct s_node *lst1, struct s_node *lst2)
{
while (lst1 != NULL)
{
struct s_node *tmp = lst2;
while (tmp != NULL)
{
if (tmp == lst1)
return tmp;
tmp = tmp->next;
}
lst1 = lst1->next;
}
return NULL;
... |
C | /* ------- file: -------------------------- molzeeman.c -------------
Version: rh2.0
Author: Han Uitenbroek (huitenbroek@nso.edu)
Last modified: Thu Jun 30 15:35:10 2011 --
-------------------------- ----------RH-- */
/* --- Routines to calculate Zeeman s... |
C | #include <stdio.h>
#include <stdlib.h>
#define CANT 5
int main()
{
int i,edad[CANT],legajo[CANT],isEmpty[CANT];
float sueldo[CANT];
for (i=0;i<CANT;i++){
isEmpty[i]=1
}
for(i=0; i<CANT; i++)
{
edad[i]=0;
sueldo[i]=0;
}
do
{
... |
C | /*
* 読み込んだ整数値を3で割った剰余を表示
*/
#include <stdio.h>
int main(void)
{
int num;
printf("整数を入力してください:");
scanf("%d", &num);
if (num % 3 == 0)
puts("その数は3で割り切れます。");
else if (num % 3 == 1)
puts("その数を3で割った余りは1です。");
else
puts("その数を3で割った余りは2です。");
return(0);
}
|
C | /*practica 4-1
saine coronado gozain
*/
#include<stdio.h>
int main()
{
int n,i;
printf("inserta un numero\t");
scanf("\n%d",&n);//guarda un entero
for (i=0;i<=n;i++){ //for desde 0 hasta n
printf("%d\n",i);}
}
|
C | #include<stdio.h>
#include<time.h>
int notPrime(int a)
{
int b=sqrt(a),i;
if(a==1)
return 1;
for(i=2;i<=b;i++)
if(!(a%i))
return 1;
return 0;
}
int power(int a)
{
int b=1,i;
for(i=0;i<a;i++)
b*=10;
return b;
}
int isTruncatable(int a)
{
int i=0;
while(a/power(i))
if(notPrime(a/power... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* 6.5
Crea un programa llamado
ex_6_5
,
en el que el usuario introduzca números enteros hasta
adivinar el número aleatorio entre 0 y 100 generado al azar por el ordenador. El programa debe
avisar si el número introducido por el usuario es más grande o más ... |
C | #include<stdio.h>
//c program to check whether a triangle is valid or not if angles are given.
int main()
{
int angle1, angle2, angle3, sum;
printf("Entert the angles of traiangle\n");
scanf("%d%d%d", &angle1, &angle2, &angle3);
sum = angle1+angle2+angle3;
if (sum == 180 && angle1 > 0 && angle2 > 0... |
C | #include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a, &b);
for(int i=a; i<=b; i++){
if(i%2!=0){
printf("%d ",i);
}
}
}
|
C | #include<stdio.h>
typedef int integer; /*TYPE DEFINATION*/
void main()
{
printf("******typedef******\n");
/*Inputs*/
integer a;
/*Output*/
printf("The Program has run without error than \n:- typedef int integer; -:\n has successfully performed\n");
}
|
C | // SyncStates.h
// Created by Chris LeCroy on Thu, Dec 4, 1997 @ 10:48 PM.
#ifndef __SyncStates__
#define __SyncStates__
// State = status of record
// Actions = Action to take
// Remote = Handheld
// Local = Macintosh or PC
// Description of states
// No Change = no changes since last HotSync
// Modify = Record mo... |
C | /*
* ClientsInterface.h
*
* Created on: 11/11/2017
* Author: Francisco Maria / Joo Gama Amaral
*/
#ifndef CLIENTSINTERFACE_H_
#define CLIENTSINTERFACE_H_
#include "MovingCompany.h"
#include <ctime>
/**
* @brief Prints a client
* @param company The company object itself.
* @return 0 o... |
C | /* Andre Amirsaleh
* Partner: Nazmul Hossain
* date/time of your lab section
* lab 04 - csv_avg.c
* compile with: gcc
* notes: none
*/
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "fileio.h"
// The CSV data is s... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_SID 13
#define MAX_NAME 64
#define MAX_EMAILID 32
#define MAX_DOB 11
#define MAX_DOMAIN_SUFFIX 16
#define MAX_STATE 32
#define MAX_CATEGORY 5
const char domain_suffix[MAX_DOMAIN_SUFFIX] = "@iitjammu.ac.in";
typedef struct date
{
unsigned short ... |
C | /*
27/11/17
erik grunner
labs 10
problem 1
*/
#include <stdio.h>
#include <stdlib.h>
#define PI 3.14
int main()
{
float radius;
float area;
float diameter;
float *ptr1;
float *ptr2;
float *ptr3;
ptr1 = &radius;
ptr2 = &area;
ptr3 = &diameter;
printf("PLease input the radius... |
C | /*
* Copyright (C) 2015-2018 Alibaba Group Holding Limited
*/
#include <k_api.h>
#include <lwip/netif.h>
#include <lwip/dns.h>
#include <lwip/tcp.h>
#include <lwip/priv/tcp_priv.h>
#include <stdio.h>
void list_if(void)
{
unsigned int index;
struct netif * netif;
krhino_sched_disable();
netif = netif_... |
C | #include <stdio.h>
int
main ()
{
int i,j; short B[50]; float n;
while(true)
{
for (i=0; i<50; i++) B[i] = 0; i = 0;
printf("Enter decimal fraction starting with a decimal point: ");
scanf("%f",&n);
while (n != 0 && i < 50)
{ n = 2.0*n;
if (n < 1.0)
... |
C | #include "catalog.h"
#include <stdio.h>
int main() {
catalog c =catalog_create("file/catalog.txt");
printf("nb occ a =%d\n", catalog_nbOccurrence(c, "a"));
printf("nb occ b =%d\n", catalog_nbOccurrence(c, "b"));
printf("nb occ z =%d\n", catalog_nbOccurrence(c, "z"));
printf("nb occ ab =%d\n", cat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.