String input output program in C C++ with space

Coding in C

#include<stdio.h>
int main()
{
    char name[20];
    puts("Enter name: ");
    gets(name);
    puts("The name is: ");
    puts(name);
    return 0;
}

Coding in C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    char name[20];
    puts("Enter name: ");
    gets(name);
    puts("The name is: ");
    puts(name);
    return 0;
}

Output

String input output program in C C++ with space

Published by

admin

I am a computer teacher, programmer and web developer