Skip to content

Instantly share code, notes, and snippets.

View ivanelson's full-sized avatar

Ivanelson Nunes ivanelson

  • Teresina, PI - BR
View GitHub Profile
@ivanelson
ivanelson / quadrado-while.c
Created December 14, 2018 22:08
Quadrado de um número em "C"
#include <stdio.h>
#include <stdlib.h>
int main () {
/* declaracoes */
int num; /* variavel utilizada para leitura da sequencia */
int quad;
/* programa */
printf("Digite uma sequencia terminada por zero\n");
@ivanelson
ivanelson / do-while-media.c
Created December 14, 2018 22:35
media com do-while in "C"
#include <stdio.h>
#include <stdlib.h>
void main() {
float nota, soma = 0, media;
int resp, contador = 0;
do {
printf("Digita a nota: ");
scanf("%f", &nota);
@ivanelson
ivanelson / vetor-notas.c
Created December 15, 2018 03:02
vetor em "C"
#include <stdio.h>
#include <stdlib.h>
int main () {
float notas[10];
int indice;
printf("Lendo as notas:\n");
for (indice = 0; indice < 10; indice++)
{
@ivanelson
ivanelson / celsius.c
Created December 15, 2018 14:36
Calcula temperatura de celsius para fahrenheit
#include <stdio.h>
#include <stdlib.h>
/*
F=1,8C + 32
*/
void main() {
float soma=0;
int valorInicial, valorFinal, contador;
printf("Digite o valor da temperatura inicial: \n");
@ivanelson
ivanelson / vetor-string.c
Created December 17, 2018 13:46
Vetor de Caracteres (String)
#include <stdio.h>
int main() {
char str[] = "meu string"; /*reserva espaço para 11 caracteres*/
/* Vou alterar o caracter da sexta posição do vetor str[] */
str[5] = 'd';
printf("Ou seja troquei o t pelo d na frase: meu string -> %s ",str);
return 0;
}
@ivanelson
ivanelson / vetor-nome.c
Created December 17, 2018 14:27
Vetor em "C" usando for e while
#include <stdio.h>
int main() {
char str[10] ; /*reserva espa‡o para 11 caracteres*/
int i;
printf("\nDIGITE Um nome qualquer: ");
gets(str);
i = 0;
@ivanelson
ivanelson / pg_upgrade.sh
Created February 7, 2019 20:13
run pg_upgrade
/usr/lib/postgresql/11/bin/pg_upgrade -U postgres --old-datadir "/opt/PostgreSQL/9.6/data" --new-datadir "/var/lib/postgresql/11/main" --old-bindir "/opt/PostgreSQL/9.6/bin" --new-bindir "/usr/lib/postgresql/11/bin"
@ivanelson
ivanelson / test.c
Created February 27, 2019 18:38
Execicio 1
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
@ivanelson
ivanelson / test.h
Created March 21, 2019 18:51
calcula o algortimo.....
#include <stdio.h>
int main()
{
printf("Hello World numero!!!");
return 0;
}
@ivanelson
ivanelson / session.php
Created November 4, 2019 20:30
start php session
<?php
session_start();
$_SESSION["login"] = $login_banco;
$_SESSION["nome"] = $nome_banco ;
?>