




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





(i) 3. (ii) 0. (iii) .12345e (iv) 2.34e (v) 1, (vi) 15e-1. (vii) 12.12e+ (viii) 150
% a single line comment /* this one /* seems like a comment */ doesn't it / / This is a comment? *\
--------------------------------------- myStuff.h----------------------- #include <stdio.h> void fun1(double); void fun2(int); -----------------------------------------------------myStuff.ccp----------
#include "myStuff.h" void fun1(double D){ for(int count = 0 ; count < D; count++){ printf("42\n"); fun2(count); } } void fun2(int I){ for(int count = 0 ; count < I; count++){ printf("1371\n"); } } -------------------------------------------------------basic.ccp----------
#include "myStuff.h" int main(void) { double n = 3; printf("start\n"); while (n > 0 ){ fun1(n); n--; } printf("done"); getchar(); return 0; } Your answer here:
Two beat artists, Slick and Monique, are going to perform together one night at the club. Unfortunately they will probably use different beat styles that only overlap a few times a minute. The club manager ask you want to make sure that there will be sufficient simultaneous beats to keep the audience enticed, so you need to get a program ready for when Slick and Monique arrive. Your program will prompt them for their beat speeds in beats per minute, and print the number of overlaps. You can assume they will both start at the same time with a beat and keep a steady pace. Hint: the frequency of coincidence is the absolute value of the difference between the two beat frequencies.
The basics are provided for you.
#include <stdio.h> int main(void) { // most of your code here
#include <stdio.h>;
int main() { int year, days; printf("what year? "); scanf("%d", year);
bool leap_year = year%1000 ~= 0; leap_year = leap_year && year%4 == 0;
for(month = 0; month <= 12; month++); { switch(month) { case 1: days = 31; break; case 2: if leap_year days = 29; else days = 28; case 4: days = 30;
otherwise: days = -1; } } }