Recent programs

Write a C program to print all even numbers between 1 to 100.

an anonymous user · February 04, 2023 · C
#include<stdio.h>
int main(){
    int i;
    for (i=1;i<=100;i++){
        if(i%2==0){
            printf("%d\n",i);
        }
    }
}

Ex 2

MarisaSales · February 04, 2023 · Python
a1= 10
a2= 3
print(a1 * a2)

e

an anonymous user · February 04, 2023 · Assembly
section .data
    msg db "Hello world!", 0ah

section .text
    global _start

_start:
    mov rax, 1
    mov rdi, 1
    mov rsi, 1
    mov rdx, msg
    syscall
    mov rax, 60
    mov rdi, 0
    syscall

e

an anonymous user · February 04, 2023 · Assembly
section .data
    msg db "Hello world!", 0ah

section .text
    global _start

_start:
    mov eax, 1
    mov rdi, 1
    mov rsi, msg
    mov rdx, 13
    syscall
    mov rax, 60
    mov rdi, 0
    syscall

Most Distant Ancestor

an anonymous user · February 04, 2023 · SQL
create table people(
  parent VARCHAR(255),
  child VARCHAR(255)
  );
  insert into people(parent, child)
VALUES ('bob', 'jack'),('jack', 'james'),('james','peter'),('peter','mike'),('mike','paul'),('joseph','roger');

with ancestor as (Select parent as p, 0 as answer from people where child='paul'
 union all
 select parent, ancestor.answer+1 as answer from people, ancestor where ancestor.p = people.child)
 select p from  where answer = (select Max(answer) from ancestor);

Ex 3

MarisaSales · updated February 04, 2023 · Python
a = 10
b =  8
print(a + b)

erde

an anonymous user · February 04, 2023 · C
#include <stdio.h>

int main() {
    printf("Hello world!\n");
    return 0;
}

A1Lab8_212101

an anonymous user · February 04, 2023 · SQL
-- nasa.sql

-- 
--
-- This database describes the United States space program, prior to the
-- space shuttle.  
--
-- If you are concerned that NASA history is not relevant
-- to a Business-oriented student, you are wrong: Forom a business perspective
-- these are just projects, and the astronauts are "just" workers assigned to
-- one or more tasks (ie. missions).
--
-- Prior to the shuttle, NASA ran five different "manned" space projects:
-- 
-- Project Mercury (1961-63): The si

ecs 132 hw 3

an anonymous user · February 04, 2023 · R
# T denotes the random variable that denotes the number of coupons that needs to be collected until one obtains a complete set of at least one type of each coupon. 
# R simulation code to compute the E(T). 

compute_t <- function(n) {           # n different types of coupons 
    coupons <- 1:n    # vector of coupons
    collected <- numeric(n)
    all_collected = 0
    t = 0
    while (all_collected == 0) {
        pick = sample(coupons, size = 1, replace = TRUE)
        if (!is.element(pick, 

Variável númerica

MarisaSales · February 04, 2023 · Python
a = 5
b = 3
print(a + b)

koolpattern.cpp

abhishek_01 · February 04, 2023 · C++
#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    //outer loop for no of rows
    for( int row=0;row<n;row++)
    {
        for(int col=0;col<row+1;col++)
        {
            cout<<row+1;
        
      if(col!=row)
            {
                cout<<"*";
            }
            
        
        
    }
    cout<<endl;
}
for( int row=0;row<n;row++)
    {
        for(int col=0;col<2*n-2*row-1;col++)
        {
            cout<<n-row;

Dixe

an anonymous user · February 04, 2023 · R
rolls = function(n) {# defines a function "rolls" which takes parameter n
  
  set.seed(12)
  x = c(1,2,3,4,5,6) # creates a 6 element vector called x
  total = 0
  for (i in 1:n) {
    y = sample(x, 1, replace = TRUE, prob = NULL) # generates a random result from x
    if (y == 5) {
      total = total + 1 # totals up every instance of 5
    }
  }
  return(total)
}

rolls(20)

concatenation-strings-3

an anonymous user · February 04, 2023 · NodeJS
let firstName = "John";
let lastName = "Doe";
let fullName = `${firstName} ${lastName}`;
console.log(fullName); // John Doe

A1Lab7_212101

an anonymous user · February 04, 2023 · SQL
-- nasa.sql

-- 
--
-- This database describes the United States space program, prior to the
-- space shuttle.  
--
-- If you are concerned that NASA history is not relevant
-- to a Business-oriented student, you are wrong: Forom a business perspective
-- these are just projects, and the astronauts are "just" workers assigned to
-- one or more tasks (ie. missions).
--
-- Prior to the shuttle, NASA ran five different "manned" space projects:
-- 
-- Project Mercury (1961-63): The six missions of 

A1Lab7

an anonymous user · February 04, 2023 · SQL
-- nasa.sql

-- 
--
-- This database describes the United States space program, prior to the
-- space shuttle.  
--
-- If you are concerned that NASA history is not relevant
-- to a Business-oriented student, you are wrong: Forom a business perspective
-- these are just projects, and the astronauts are "just" workers assigned to
-- one or more tasks (ie. missions).
--
-- Prior to the shuttle, NASA ran five different "manned" space projects:
-- 
-- Project Mercury (1961-63): The si

hist in r

Cruz · February 04, 2023 · R
set.seed=44889


x <- round(rnorm (1000,5,2))
m = mean(x)
s= sd(x)

m 
s 

concatenation-strings-2

an anonymous user · February 04, 2023 · NodeJS
let firstName = "John";
let lastName = "Doe";
let fullName = firstName.concat(" ", lastName);
console.log(fullName); // John Doe

concatenation-strings-1

an anonymous user · February 04, 2023 · NodeJS
let firstName = "John";
let lastName = "Doe";
let fullName = firstName + " " + lastName;
console.log(fullName); // John Doe

kathe'sclass.js

an anonymous user · February 04, 2023 · C++
#include <iostream>
using namespace std;
int main() {

    return 0;
}

replace-string

an anonymous user · February 04, 2023 · NodeJS
let name = "John Doe";
name = "Jane Doe";