Quantcast
Channel: Microcontrollers, Programming and IoT
Viewing all articles
Browse latest Browse all 1271

Program to print a string

$
0
0
I have written two different to print string in c programming
Code:
#include <stdio.h>

 int main()
{
    char Book  = "Electronics";

    printf("Name of Book is  %s \n",Book);

    return 0;
}
warning: initialization makes integer from pointer without a cast [-Wint-conversion]
char Book = "Electronics";

Program 2
Code:
#include <stdio.h>

 int main()
{
    char Book [20] = "Electronics";

    printf("Name of Book is  %s \n",Book);

    return 0;
}
Name of...

Program to print a string

Viewing all articles
Browse latest Browse all 1271

Trending Articles