Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Need help with this problem!
Write two scanf statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash and the year. End with newline. The program will be tested with inputs 1 2000 and then with inputs 5 1950. Ex: if the input is 1 2000, the output is 1/2000 Note: The input values come from user input, so be sure to use scanf statement, as in scanf(ā%dā, &birthMonth), to get those input values( and donāt assign values directly, as in birthMonth=1)
3 Respostas
0
#include <stdio.h>
Int main(void) {
Int birthMonth;
Int birthYear;
Scanf (ā%dā, &birthMonth);
Scanf(ā%dā, &birthYear);
Printf(ā%dā, birthMonth);
Printf(ā%dā, birthYear);
return 0;
}
My output is 12000 instead of 1/2000
0
#include <stdio.h>
Int main(void) {
Int birthMonth;
Int birthYear;
scanf (ā%dā, &birthMonth);
scanf(ā%dā, &birthYear);
printf(ā%d/%dā, birthMonth, birthYear);
return 0;
}
0
#include <stdio.h>
int main(void) {
int birthMonth;
int birthYear;
scanf("%d", &birthMonth);
scanf("%d", &birthYear);
printf("%d", birthMonth);
printf("/%d\n", birthyear);
return 0;
}