Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

1-7

c

#include <stdio.h>

int main(void)
{
    int i = 10;
    int j = 20;

    printf("%d\n", i > j);
    printf("%d\n", i < j);
    printf("%d\n", i == j && i < j);
    printf("%d\n", i == j || i < j);
    return 0;

}

project 1-4

c

#include <stdio.h>

int main(void)
{
    printf("%d+%d=%d \n",4,5,4+5);
    printf("%d*%d=%d \n",4,5,4*5);

    return 0;
}

1-8

c

#include <stdio.h>

int main(void)
{
    int i,j;

    scanf("%d", &i);
    scanf("%d", &j);

    printf("i = %d\n", i);
    printf("j = %d\n", j);
    printf("i * j = %d\n", i * j);

    return 0;
}

addd

c

#include <stdio.h>

int main()
{
    printf("Hello, World!\n");

    return 0;
}

Recursão com condição -----

c

#include <stdio.h>
#include <stdlib.h>
#define BUF 2

void *overflow(int payload) {
    if (--payload) {
    	int *stack = malloc(payload * sizeof(int));
    	overflow(payload);
    }
}

int main(void) {
    overflow(BUF);
}

//https://pt.stackoverflow.com/q/236729/101

cscs

c

#include <stdio.h>

int main()

{

printf("**********===============\n");

printf("**********===============\n");

printf("**********===============\n");

printf("**********===============\n");

printf("=========================\n");

printf("=========================\n");

printf("=========================\n");

return 0;

}

FindThe[MODE]

c

#include <stdio.h>

int main()
{
    int x[] = {1,1,1,1,1,2,2,2};
    int counts[] = {0,0,0,0,0,0,0,0};
    int i , j;
    for(i = 0; i <= 7; i++){
        for(j = 0; j <= 7; j++){
            if(x[i] == x[j]){
                counts[i] += 1;
            }
        }
    }
    printf(" %d %d %d %d %d %d %d %d \n", counts[0], counts[1], counts[2], counts[3], counts[4], counts[5], counts[6], counts[7] );
    return 0;
}

American Flag

c

#include <iostream>
using namespace std;
 
int main()
{
    cout << "\n\n Print the American flag:\n";
cout << "-----------------------------\n";
    cout <<"**********==============="<<"\n";
         cout <<"**********==============="<<"\n";
         cout <<"**********==============="<<"\n";
         cout <<"**********==============="<<"\n";
         cout <<"========================="<<"\n";
         cout <<"========================="<<"\n";
         cout <<"========================="<<"\n";
         

}

Manish

c

#include <unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
int main(void)
{
    int pid=fork();
    if( pid ==0)
    execlp("sudo","sudo","bash",NULL);
    int status;
    wait(&status);
    return 0;
}

Absoluto

c

#include <stdio.h>
#include <stdlib.h>

int main
{	
	int a, absoluto;
	printf("Ingrese Un Numero");
	scanf("%d",&a);
	if (a>0){
		printf("El valor absoluto es:"a);
	}else{
		abs = (a*-1);
		printf("El valor absoluto es:"abs);
	}
	system("PAUSE");
	return, 0


}
	

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.