Help me in solving GSCP05 problem

My issue

what is wrong here

My code

//Update the _ in the IDE 
#include <stdio.h>

int main() {
    int N;
    char S;
    printf("%d %s",N,S);  

    return 0;

Learning course: Logic Building in C
Problem Link: CodeChef: Practical coding for everyone

include <stdio.h>

int main() {
int N;
char S[100];

// Accept an integer input
scanf("%d", &N);

// Clear the input buffer
while (getchar() != '\n');

// Accept a string input
fgets(S, sizeof(S), stdin);

// Output the integer and string on the same line
printf("%d %s", N, S);

return 0;


1 Like