Giter Site home page Giter Site logo

alx-low_level_programming's People

Contributors

tolulope05 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alx-low_level_programming's Issues

If you can u do figure this PROGRAMMING Read and understand the following code. Provide the correct input to have the program print the sentence: Exactly! Good Job.

Before submitting your answer, please check its correctness by executing the code.
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
static int64_t ac_dc[] = { 14479, 12574, 54786, 51996, 77903, 16499 };
const static int N = sizeof(ac_dc)/sizeof(*ac_dc);
static void fail(){
puts("Nope!");
exit(EXIT_FAILURE);
}
static void linkin_park(int64_t i, int64_t z, int64_t o){
if ( i - o / 7 + 3 * z / 11 )
fail();
}
static void the_beatles(int n, int64_t u){
int64_t s = u;
for(; n<N; ++n) {
if ((n % 2) == 0)
continue;
s += ac_dc[n];
}
if (s != 159276)
fail();
}
static void metallica(int y, int64_t d){
if (y<N) {
if (y % 2)
metallica(++y, d);
else metallica(y + 1, d * ac_dc[y]);
} else if (d != 197887032)
fail();
}
int main(){
int64_t r, l, h;
printf("Please enter the right three numbers: ");
fflush(stdout);
if (scanf("%" SCNd64 " %" SCNd64 " %" SCNd64, &r, &l, &h) != 3)
fail();
ac_dc[0] = r;
ac_dc[5] = l;
ac_dc[4] = h;
the_beatles(0, 92627);
metallica(1, 3);
linkin_park(r, l, h);
puts("Exactly! Good job.");
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.