language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | /**
* \file file.c
* \author Rangarajan R
* \date March, 2016
* \brief
* Predict the output.
*
* \details
* Detailed description of file.
*
* \note
* The notes for this file.
*
* \copyright
*
*/
#include <stdio.h>
int main()
{
int var; /*Suppose address of var is 2000 */
void *ptr... |
C | //Program : Question 22 (Program to reverse the string)
//Author : Roshan Aji Cherian
#include <stdio.h>
#include <string.h>
#define MAX 1001
int main()
{
char str[MAX];
printf("Enter the string to be reversed : ");
scanf("%[^\n]%*c", str); //Syntax to input the string having spaces
int n = strlen(str);... |
C | #include <stdio.h>
#include <stdlib.h>
#define STATUS "student"
#define SREDNIA_OCEN 3.4
void data();
int main() {
data();
return 0;
}
void data(){
int pe, k, d, mie;
char i[16], n[16], pl[8], mia[16], u[32];
printf("Podaj imie: ");
scanf("%s", &i);
printf("Podaj nazwisko: ");
scanf("%s", &... |
C | #include <stdio.h>
#include "cll.h"
#include "os.h"
/*
File name : linkMain.c
Day : Data Structures
Purpose : Creating a linked list main function
*/
int main()
{
NODE *head = NULL;
NODEELEMENT data;
char choice;
int position,ch;
while(1)
{
clearScreen();
puts("\t\t\t\tLinked List Operations\n");
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#define DRIVER_AMOUNT 20
#define CAR_AMOUNT 5
pthread_mutex_t cars[CAR_AMOUNT];
pthread_t drivers[DRIVER_AMOUNT];
void* test_automobiles(void* args) {
int id = *((int*) args);
free(args);
for(int i = 0; i < CAR_AMOUNT; i++) { // one ... |
C | #include "error_functions.h"
static void error_dealer(int errnoflag, int level, const char *format, va_list ap){
const int MAXSIZE = 256;
int errno_save,n;
char buf[MAXSIZE +1];
errno_save = errno;
int daemon_proc = 1;
#ifdef HAVE_VSNPRINTF
vsnprintf(buf, MAXSIZE, format, ap);
#else
vsp... |
C | #include <stdio.h>
#define MAXLINE 1000 /* maximum input line length */
/* using global variables in this implementation */
int max;
char line[MAXLINE];
char longest[MAXLINE];
int get_line(void);
void copy(void);
/* print longest input line; specialized version */
main()
{
int len;
extern int max;
ex... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
Given a n*n matrix where numbers all numbers are distinct and are distributed from range 1 to n2, find the maximum length path (starting from any cell) such that all cells along the path are increasing order with a difference of 1.
We can move in 4 directi... |
C | #include <stdio.h>
#include <stdlib.h>
#include <stdalign.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
#include <inttypes.h>
#include "utils.h"
#ifdef DEBUG
#define dbg_printf(...) (fprintf(stderr, __FILE__ ":%d:%s:", __LINE__, __func__), (fprintf(stderr, __V... |
C | #include<stdio.h>
#include<stdlib.h>
#include"stack.h"
void visit(void *value)
{
printf("%4d", *(int *)value);
}
int main()
{
stack S=NULL;
void *e;
int v_1 = 1;
int v_2 = 2;
int v_3 = 3;
int v_4 = 4;
int v_5 = 5;
int v_6 = 6;
S=InitStack();
S=Push(S, (void *)&v_1);
S=Push(S, (void *)&v_2);
S=Push(S, (voi... |
C | /**********************************************************
* File : q2.c
* Author : Jan Claasen <janclaasen@gmail.com>
* Date : 20.03.2018
* Last Modified Date: 20.03.2018
* Last Modified By : Jan Claasen <janclaasen@gmail.com>
***********************************************... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include "kargergraph.h"
unsigned int get_tick_count()
{
struct timespec ts;
clock_gettime( CLOCK_REALTIME, &ts);
unsigned int ticks = ts.tv_nsec / 1000000;
ticks += ts.tv_sec * 1000;
return ticks;
}
... |
C | #include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "commandlinereader.h"
#include "list.h"
#define TAMMSG 1000
#define BUF 100
#de... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
typedef struct {
int* data;
int top;
int size;
}Stack;
int initialStatus(int size){
Stack* sp = (Stack*)malloc(sizeof(Stack));
if (sp == NULL) {
printf("Error, an error has occured in the memory allocation process for... |
C | #include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include "fix_queue.h"
typedef struct
{
void *buf_queue;
} bus_ctx_t;
void *bus_init(size_t capacity)
{
void *buf_queue = fix_queue_init(capacity);
if (buf_queue == NULL)
{
return NULL;
}
bus_ctx_t *ctx = calloc(1, sizeof(bus_... |
C | #include "sequentialStack.h"
/* This function turns a prefix expression stored in 'prefiExpression' into a postfix expression
and stores it in 'postfixExpression'
If everything is all right, RETURN SUCCEEDED; otherwise, RETURN FAILED
*/
State infixToPostfix(char *infixExpression,char postfixExpression[]);
/* ... |
C | #include <msp430.h>
#define STOP 0x00
#define RUN 0x01
#define FAST 0x00FF
#define MEDIUM 0x0FFF
#define SLOW 0x7FFF
#define LED_DIR P1DIR
#define LED P1OUT
void delay(void) {
volatile unsigned int j = SLOW;
while(j > 0) j--;
}
int main(v... |
C | #include <stdio.h>
int main(){
float m;
float k;
float v = 3.6;
// km/h para m/s
printf("Digite o valor em km/h : ");
scanf("%f", &k);
m = k / v;
printf("\nA velocidade de %f km/h convertido eh de : %f m/s ", k, m);
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "../include/primitive.h"
#include "../include/filters.h"
#include "../include/imageTreatment.h"
void grayFilter(Image *img) {
int i, j;
for(i = 0; i < img->height; i++) {
for(j = 0; j < img->width; j++) {
//Apl... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct stack *Stack;
struct stack {
char * array;
int size;
int top;
};
Stack createStack(int arraySize) {
Stack S = (Stack)malloc(sizeof(struct stack));
S->size = arraySize;
S->top = -1;
S->array = (char *)malloc(sizeof(int) * arraySize);
re... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi.c :+: :+: :+: ... |
C | #include <stdio.h>
int celc(int);
int main() {
int temp;
printf("\nPlease enter temp F: ");
scanf("%d", &temp);
printf("\n%dF to centigrade is %dC\n", temp, celc(temp));
return 0;
}
int celc(int f) {
return 5 * (f - 32) / 9;
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int sum(int *array, int cols)
{
int out = 0;
for(int i=0;i<cols;i++)
{
out = out + *(array+i);
}
return out;
}
int main()
{
FILE *fp;
FILE *out;
fp = fopen("A-large.in", "r");
if (fp==NULL)
{
printf("E... |
C | /*The client program has the following major steps:
1) Create a socket
2) Connect the socket to the address of the server
3) Send and recieve datapes.h
*/
#include<stdio.h>
#include<stdlib.h>
#include<strings.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<netdb.h>
#include<unistd.h>
... |
C | #include <stdio.h>
#define T(x) puts(">>> " #x); x
int main() {
int i = 3;
int * p = &i;
printf("i == %d, p == %p\n", i, p);
T(*p = 4;)
printf("i == %d, p == %p\n", i, p);
T(p = 5;)
printf("i == %d, p == %p\n", i, p);
return 0;
}
|
C |
//**************************************************************
// Assignment #4
// Name: Christian Norfleet
// Parallel Programming Date: Date of Submission (4/17/2017)
//***************************************************************
// This program will implement the use of the double buffering technique.
// It wi... |
C | /*
**********************************************************************************
** ļ˵MMA8452ٶоƬ
** ļƣAcceleration.c
** ڣ2013.05
** ˣXZY ... |
C | // tprof.c
// Essai des fonctions de profile de biberc
// 23/05/95 PV
#include <stdio.h>
#include <string.h>
#include <biberc.h>
char szNomIni[] = "tprof.ini";
int main()
{
char filename [256];
char szRemoteHost[80];
char szBuffer[5000];
char szValeur[500];
char *p;
strcpy(szRemoteHost, "serveur.erce... |
C | /* =========================================================================
zarmour - armoured text encoding and decoding
Copyright (c) the Contributors as noted in the AUTHORS file.
This file is part of CZMQ, the high-level C binding for 0MQ:
http://czmq.zeromq.org.
This Source Code Form is sub... |
C | #include<stdio.h>
#include<math.h>
#define ll long long int
#define integer_size 32
ll setbits[integer_size+1];
ll countBitsUtil(ll a,ll b){
if(b<=1)
return b;
ll sa=1+log2(a);
ll sb=1+log2(b);
if(sa<sb){
ll x,y,z;
ll ma=(1<<(sa-1));
x=(a&(a-1)==0)?setbits[sa]-setbits[sa-... |
C | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#define TRSD 50 // threshold
// Function prototypes
void mergeSort(int items[], int low,int numElements);
void mergeSortSC(int items[], int low, int numElements);
void insertionSort2(int items[],int low, int high);
void swap(int x, int y,int items[]);
void pr... |
C | /****************************************************************
****
**** This program source is part of
**** Introduction to High-performance Scientific Computing
**** by Victor Eijkhout
**** copyright Victor Eijkhout 2011-2020
****
**** gdb example program
****
*********************************************... |
C | #include <stdio.h>
#define STOP 0
int main() {
int counter;
int startpoint;
printf("=====Countdown program=====");
printf("Enter a positive integer: ");
scanf("%d",&startpoint);
for(counter = startpoint; counter >= STOP; counter--) {
printf("counter: %d\n",counter);
printf("c... |
C | /* {d: Ch9-3-1.c */
#include <stdio.h>
#include <stdlib.h>
#define MAX_LEN 20 /* ̤jr */
/* : Xְ}C */
void merge(char *data,int start,int mid,int end) {
int left = start; /* b */
int right = mid + 1; /* kb */
int i;
char *finalData;
/* tmXְϬqһݪOŶ ... |
C | //
// main.c
// 07project13
//
// Created by cappuccino on 2020/11/26.
//
#include <stdio.h>
int main(int argc, const char * argv[]) {
int length = 0,word = 1;
float average = 0;
char ch;
printf("Enter a sentence:");
while ((ch = getchar()) != '\n') {
if(ch == ' ')
word++;
... |
C | /* ************************************************************************** */
/* */
/* :::::::: */
/* ft_itoa.c :+: :+: ... |
C | #pragma once
#ifndef _nvdata_h_
#define _nvdata_h_
/**
* Non-volatile data storage
*
* Data is saved in blocks of data size + 1 in the persistent storage (internal/external flash)
* until the flash sector is full.
*
* Upon a full sector, the sector is erased and data written from the beginning.
*
* Sector s... |
C | #include <stdio.h>
#include <math.h>
int main()
{
int b,a,c;
scanf("%d",&a);
c=pow(a,2);
printf("%d",c);
}
|
C | #include <stdlib.h>
#include <stdio.h>
#include "stack.h"
/* static para serem visíveis apenas aqui */
static s_type_t * pStack = 0; /* apontador para o array de suporte à stack */
static int capacity; /* capacidade da stack */
static int actSize; /* tamanho atual da stack */
/*
DESCRIÇÃO: Inicializa uma stack com a... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* maths_rot.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define TRUE 1
#define FALSE 0
extern int h_errno;
int main(int argc, char *argv[])
{
int x1, x2;
struct hostent *hp;
... |
C | #include <getopt.h>
#include <stdlib.h>
#include <stdio.h>
#include "common.h"
#include "window.h"
#include "console.h"
char *frontend = "gtk";
char *dev_name = "/dev/video0";
char *path = "/data/capture/";
char *tmp_path = "/tmp/";
static const char short_options[] = "f:d:po:ts";
static const struct option long_opti... |
C | #include<stdio.h>
int main()
{
int a,b;
printf("Enter the first number\n");
scanf("%d",&a);
printf("Enter the second number\n");
scanf("%d",&b);
if(b>0){
while(b!=0){
a++;
b--;
}
}
else if(b<0){
while(b!=0){
a--;
b++... |
C | #include <stdio.h>
int main(){
unsigned int n;
int x, count=0;
scanf ("%d",&n);
for(int i=0; i<n; i++){
scanf("%d", &x);
if(x<0){
count++;
}
}
printf ("%d", count);
return 0;
}
|
C | /*3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.
Examples:
Given "abcabcbb", the answer is "abc", which the length is 3.
Given "bbbbb", the answer is "b", with the length of 1.
Given "pwwkew", the answer is "wke", with the len... |
C | #include "csapp.h"
#define ITERATIONS 10
#define THREADS 2
int readcnt;
sem_t mutex, w;
void* reader(void* v) {
for (int i = ITERATIONS; i>0; i--) {
P(&mutex);
readcnt++;
if (readcnt == 1)
P(&w);
V(&mutex);
// Critical section
sleep(1);
printf("reader\n");
P(&mutex);
readcnt--;
if (readcnt... |
C | #include<stdio.h>
long long int max(long long int,long long int);
long long int maximum(long long int*,long int);
int minimum(int*,long int);
int main()
{
int test;
long int n;
int in[100000];
long long int s[100000];
long long int sum = 0,out1[10],out2[10],max1,min1;
int i,j,k,p,q;
scanf("%d",&test);
for(i... |
C | /**
@file power_consumption.c
@brief Documentation for CLEON power consumption
@page PWR Power consumption
@section PWR Power consumption
- This chapter describe the power consumption in case of three GPS signal chunks capturing with 50ms chunk gap
... |
C | #include <linux/input.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
//frame buffer
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <sys/mman.h>
//#define POS_DEBUG
#define DEVICE_FRAME_BUFFER "/dev/fb0"
#define DEV... |
C | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <stddef.h>
#include <unistd.h>
#include <getopt.h>
#include <string.h>
#include <linux/limits.h>
#include "garmin/garmin.h"
#include "garmin/fit.h"
#include "garmin/fit_definitions.h"
#include "print_csv.h"
/***********************... |
C | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "util_mem.h"
#include "io_url.h"
#include "util_string.h"
//
// Returns true if both urls are logically equal
//
bool io_url_equals(
io_url_t* that,
i... |
C | #include <stdio.h>
#include <math.h>
struct point
{
float x;
float y;
};
void fpoint ( struct point pc );
float Isperpendicular (struct point p1, struct point p2,struct point p3,struct point p4);
int main ()
{
struct point pt1, pt2,pt3,pt4 ;
float p;
fpoint( pt1 );
fpoint( pt2 );
fpoint( pt3 );
fpoint(pt4 );
p=Isp... |
C | /*
** EPITECH PROJECT, 2018
** init
** File description:
** and result;
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "my.h"
#include "struct.h"
void print_result(matrix_t mat, int x, int y)
{
int cpt = 0;
while (cpt != 3) {
printf("%.2f", mat.matrix[cpt][0]);
... |
C | #include <stdio.h>
#include <stdlib.h>
/* TAD: ListaDup */
struct listaDup{
int info; /* Informao guardada na lista */
struct listaDup *ant; /* Ponteiro para o elemento anterior da lista */
struct listaDup *prox; /* Ponteiro para o prximo elemento da lista */
};
/* Tipo exportado */
typedef struct lis... |
C | #define _SERVER_H_
#include "mysockets.h"
/*
* Author: Jeff Mariconda
* Class: CS-392
*
* Client program for the basic IRC application.
*/
//Prints goodbye message and ends the client on SIGINT.
void client_bye(int sig)
{
int m;
if (sig == SIGINT) {
my_str("\nReceived Interrupt. Now Exiting.\n\n");
} e... |
C | #include "video.h"
#include <SDL.h>
#include "debug.h"
#include "input.h"
#include "scaler.h"
SDL_Surface *screen;
SDL_Surface *screenScaled;
int screenScale;
int fullscreen;
Uint32 curTicks;
Uint32 lastTicks = 0;
int initSDL()
{
if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK))
{
return -1;
}
SDL_WM_SetCaption(... |
C | #include "types.h"
#include "user.h"
#include "date.h"
int
main(int argc, char *argv[])
{
struct rtcdate r;
if (date(&r)) {
printf(2, "date failed\n");
exit();
}
printf(
1,
"%d/%d/%d %d:%d:%d\n",
r.month,
r.day,
r.year,
r.hour,
r.minute,
r.second
);
exit();
}
|
C | #include <stdio.h>
#include "luz.h"
#include "codigo.h"
#include "alarma.h"
#include "timeval_helper.h"
int p_alarma;
int boton;
int presencia;
struct timeval espera_deadline1;
void scan_keyboard () {
char buf[256];
struct timeval timeout = {0,0};
fd_set rdset;
FD_ZERO (&rdset);
FD_SET (0, ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
/* 1- Ler a idade, o peso e o sexo de N alunos e mostrar:
-Media de pesos dos homens;
-Quantidade de homens com mais de 80kg;
-Media de idades das mulheres;
-Quantidade de mulheres acima de 25 anos;
Consistencias:
-Idade e pes... |
C | /*
* dice.c
*
* Created: 27/12/2014 19:03:20
* Author: JONATHAN
*/
#include <avr/io.h>
#define F_CPU 8000000UL
#include <avr/interrupt.h>
#include <util/delay.h>
#include <stdlib.h>
int contador;
int tempo;
int vector[]={0b11000000,0b10100100,0b11100100,0b10101101,0b11101101,0b10111111,0b11111111};
void pu... |
C | #include <time.h>
#include "player.h"
#include "../lib/set-src/include/set.h"
#include "graph_manager.h"
#include "methods.h"
#include "WTree.h"
static char *player_name = "PSX";
struct s_player {
struct graph_t *player_graph;
enum color_t player_color;
struct set *available_vertices;
WTree *player_tree;
WTree *... |
C | /* -----------------------------------------------------------------------------
* Filename : Security_System.c
* Author(s) : Kyle Bielby, Chris Lloyd (Team 1)
* Class : EE365 (Final Project)
* Due Date : 2020-11-23
* Target Board : Cora Z7-10
* Description : Multi-mode simple security system.
... |
C | /**
* Pointers Gone Wild Lab
* CS 241 - Spring 2018
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "callbacks.h"
#include "part3-functions.h"
#include "vector.h"
vector *vector_map(vector *input, mapper map) {
// TODO implement this
char* temp;
vector *output_vector ... |
C | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
char * strdub(char * str){
int len = strlen(str);
char * buff = malloc(sizeof(char) * len);
int i = 0;
for(i=0; i<len; i++){
buff[i] = str[i];
}
return buff;
}
int main(int argc, char** argv){
if(argc != 2){
printf("no program t... |
C | #include<stdio.h>
int gcd(int,int);
int main()
{
int a,b,i,j;
printf("Enter two integers:");
scanf("%d %d",&a,&b);
i=gcd(a,b);
printf("gcd of a and b is:%d\n",i);
return 0;
}
int gcd(int m,int n)
{
if (n != 0)
return gcd(n, m % n);
else
return m;
}
... |
C | /*
** recup_argv.c for recup_env in /home/danilo_d/rendu/PSU_2014_minishell1
**
** Made by Danilov Dimitri
** Login <danilo_d@epitech.net>
**
** Started on Thu Jan 15 13:40:24 2015 Danilov Dimitri
** Last update Sun Feb 1 17:13:45 2015 Danilov Dimitri
*/
#include "my.h"
int find_bad_arg(t_arg *arg)
{
int i;
... |
C | /* In case of Java language,
the main class must be named as "M"+Problem ID */
#include<stdio.h>
int main()
{
double r;
scanf("%lf",&r);
printf("A=%.4lf\n",3.14159*r*r);
return 0;
} |
C | #include "WiFi.h"
#include <FS.h>
#include <SPIFFS.h>
#define BOUNDARY "xx---xx--xx"
#define TIMEOUT 250000
#define BUFSIZE 100
uint8_t buffer[BUFSIZE];
const char* host = "knock.aksharsolanki.com";
String body(String content , String message);
String header(size_t length);
void sendpicture()
{
File file = SPIFF... |
C | #include <mqueue.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <inttypes.h>
#include <string.h>
#include "msg.h"
// This handler will be called when the queue
// becomes non-empty.
void handler (int sig_num) {
printf ("Received sig %d.\n", sig_num);
}
void main (... |
C | //Bibliotecas
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
//Estrutura
struct str_no {
char dado;
int valNo;
int esquerda;
int direita;
int pai;
};
//Vari�veis globais
char vetorValores[9] = {'+','*','5','-','+','6','3','4','1'};
struct str_no arvore[16];
//Prototipa��o
void menu_mostrar(void);
... |
C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv){
int i, j, input, sum = 0;
int subject, student;
int **score_board;
/*
score_board[subject][student] 배열을 만들 예정이다.
*/
printf("과목 수를 입력해주세요. : ");
scanf("%d", &subject);
printf("학생 수를 입력해주세요. : ");
scanf(... |
C | #include "bmp.h"
#include "uquantize.h"
int main(int argc, char *argv[])
{
if(argc < 3)
{
printf("Blad przy wpisywaniu argumentow.");
return 2;
}
char *image = get_image(argv[1]);
display(image);
int levels = atoi(argv[3]);
if(levels > 255)
{
printf("Za duza w... |
C | // Gisela Neira
// C++ Basics E228
// * Programm 02.03.01 der C/C++ Programmierung
// * wchar_t
#include <stdio.h>
#include <locale.h>
#include <wchar.h>
#define LONG 3
int main()
{
wchar_t text1;
char text2;
wprintf(L"Eingabe: \n");
wscanf(L"%c", &text1);
wprintf(L"Ausgabe: %c\n", text1);
... |
C | /*
* 3 instances of the same thread
*/
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <unistd.h>
#define TASK 300000000
long int sum;
long int *p;
void *
u_thr() {
long int lsum = 0;
for (; lsum < TASK; ) {
lsum += 1;
}
*p += lsum;
printf("partial from thread with tid %d\n", ... |
C | /*************************************************************************
* File Name : 62.c
* Author : unasm
* Mail : unasm@sina.cn
* Last_Modified: 2015-05-17 19:05:12
************************************************************************/
#include<stdio.h>
int line[10000];
int uniquePaths... |
C | /* File c_comparator.c */
#include "comparator.h"
int comparator(char* a, char* b)
{
int i = 0;
while((a[i] != '\0')&&(b[i] != '\0'))
{
if (a[i] > b[i])
{
return 1;
}
else
{
if (a[i] < b[i])
{
return 0;
}
}
i++;
}
if (a[i] == '\0')
{
return 0;
}
return 1;
}
|
C | #include <msp430.h>
/*
* HARDWARE PWM 5529.
*
* Created on: Oct 10, 2017
* Last Edited: Oct 10, 2017
* Author: Tyler Brady
*/
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P2DIR |= BIT0; // Set P2.0 to output direction
P4DIR |= BIT7; // Set P4.7 to output
P2SEL |= BIT0; ... |
C | #ifndef UASDK_BUFFER_H_
#define UASDK_BUFFER_H_
#include <stdint.h>
#include <UASDK_defs.h>
#include <wchar.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
union {
uint8_t *pbytes;
uint16_t *pword;
char* pstring;
wchar_t* pwstring;
} head;
UASDK_caplen_t c... |
C | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct ListNode* removeElements(struct ListNode* head, int val)
{
if(!head) return head;
struct ListNode* temp=NULL;
while(head!=NULL && head->val==val)
{
temp=head;
head=head->next;
... |
C | #include <cstdio>
#include <cmath>
inline long long gcd_extend(int &a, int b, long long *x, long long *y) {
static long long r, t;
if (b == 0) {
*x = 1, *y = 0;
return a;
} else {
r = gcd_extend(b, a % b, x, y);
t = *x;
*x = *y;
*y = t - a / b * *y;
r... |
C | #include<stdio.h>
#include<conio.h>
#include<math.h>
float x,y,errorusuario;
float e_test=0, f_xu, f_xl, xr, f_xr;
float iteracion1, iteracion2;
float raiz;
float f_x(float x)
{
return (pow(x,3)+4*pow(x,2)-10);
}
float operacion(float x_l,float x_u,float e)
{
e_test=(x_u-x_l)/2;
while(e_test>e)
... |
C | //CAU 1: GIAI VA BIEN LUAN HE PT BAC NHAT HAI AN - CODING BY NTK
#include <stdio.h>
int main()
{
float a1,a2,b1,b2,c1,c2;
float d,dx,dy;
printf("Nhap cac he so cua he phuong trinh: \n");
printf(" a1.x + b1.y = c1 \n ");
printf(" a2.x + b2.y = c2 \n ");
printf("*************************************... |
C | #include <stdlib.h>
#include <stdio.h>
#include "header.h"
int main(int argc, char *argv[])
{
int i;
int m,n;
przerwij_program = 0;
if(argc !=4)
{
fprintf(stderr, "Aby poprawnie wywolac program podaj ilosc rownan, ilosc niewiadomych i gdzie jest macierz!\n");
return 1;
}
m = atoi(argv[1]);
n = atoi(argv... |
C | #ifndef EVENT_H
#define EVENT_H
enum Signal { blockage, up, down, stop, coiled, unrolled, moving, standing };
//az esemény nem tartalmazhat most adattagokat, csak ha létrehozunk egy leszármazott osztályt belőle
struct Event
{
Event(Signal e) : ev(e) {}
Signal ev;
};
#endif // EVENT_H
|
C | #include <stdio.h>
void showarr(int [][5], int);
void dbarr(int [][5], int);
int main(void)
{
int ar[3][5] = {
{1, 2, 3, 4, 5},
{3, 4, 5, 6, 7},
{5, 7, 9, 1, 3}
};
showarr(ar, 3);
dbarr(ar, 3);
showarr(ar, 3);
return 0;
}
void showarr(int ar[][5], int... |
C | //
// Created by kosta on 8/25/2015.
//
#include "stdio.h"
#include "limits.h"
int main(){
long long x;
double y[3] = {1.0, 2.0};
printf("%d\n", sizeof(x));
printf("%d", sizeof(y));
return 0;
} |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_hex.c :+: :+: :+: ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* matrix.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#define CANT 2
int main()
{
int i;
// int edad1;
// int edad2;
float salario[CANT];
int edad[CANT];
int legajo[CANT];
for(i=0; i<CANT; i++)
{
printf("Edad %d: ",i+1);
scanf("%d",&edad[i]);
printf("Salario %d: ",i+1);
... |
C | //Adam Granieri
//COE 0449 Systems Software
//Fall 2018
//Copied libraries and Block size from serv.c for consitency
#include <stdlib.h>
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <getopt.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
//Added l... |
C | /*************************************************************************
> File Name: gccsyc.c
> Author:
> Mail:
> Created Time: Sat 03 Oct 2015 08:29:20 PM CDT
************************************************************************/
#include<stdio.h>
#include <pthread.h>
#include <stdlib.h>
static int coun... |
C |
#include <stdlib.h>
#include <stdio.h>
#include <R.h>
#include <Rinternals.h>
#include <Rmath.h>
/********************************************************************************************************
invert inverts a function
***************************************************************************************... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... |
C | #include<stdio.h>
#include<conio.h>
int main()
{
char ch= '\0';
printf("\n Enter a Character to View Corresponding Message=");
ch=getche();
switch(ch)
{
case 'a':
printf("\n Welcome");
break;
case 'A':
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <conio.h>
#include "LinkedList.h"
#include "Controller.h"
#include "Employee.h"
#include "validaciones.h"
/** \brief Parsea los datos los datos de los empleados desde el archivo data.csv (modo texto).
*
* \param path cha... |
C | // 009 - ּ
#include<stdio.h>
/*
ȳϼ
*/
main()
{
int i;
int hap = 0;
for (i = 1; i <= 10; i = i + 1)
{
hap = hap + i;
}
printf(" 1 10 : %d \n", hap);
} |
C | float restar (int i, int j){
if (i > 0)then {
return restar(i - 1, j + 1);
} else {
return j;
}
}
void main (int args){
int vara;
int varb;
vara = 5;
varb = 10;
int varc;
varc = restar(vara, varb);
printf(varc);
} |
C | /*
* Shiying Zheng and Ben Stern, hw9
* A sorted list built upon a linkedlist.
*/
#include "sortedlist.h"
/*
* Initialize a sortedlist.
* Takes in an integer which is the size of each element of the sortedlist,
* and a comparator which takes in two void pointers, compare them, and
* returns an int.
* Returns... |
C | //program to print the fibonacci series upto n numbers
#include<stdio.h>
int main()
{
int n, first_term=0, second_term=1,sum=0, next_term ;
printf("Enter the number of terms upto which you want to print the fibonacci series\n");
scanf("%d", &n);
while(sum<=n){
printf("%d ", sum);
f... |
C | #ifndef _MY_LIST_H_
#define _MY_LIST_H_
#ifdef _MY_LIST_C_
#define _MY_LIST_C_EXT_
#else
#define _MY_LIST_C_EXT_ extern
#endif
/*
//#define container_of(ptr, type, member) ({ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
// (type *)( (char *)__mptr - offsetof(type,member) );})
*/
#define __offset... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.