#include<stdio.h>


void printstr(char str[])
{
    int i=0;
    while(str[i]!='\0')
    {
        printf("%c", str[i]);
        i++;
    }
    printf("\n");
}
int main()
{
    // // char str[] = {'a','a','t','i','f','a','\0'};
    // char str[7] = "aatifa";
    char str[34];
    gets(str);
    printf("Using custom function printstr\n");
    printstr(str);
    printf("Using printf %s\n", str);
    printf("Using puts: \n");
    puts(str);
    return 0;
}

Comments

Post a Comment

Popular posts from this blog

C Program using continue statement

C program of WHILE Loop

NULL Pointer in C.

C Program using DO WHILE loop

C Program using SWITCH statement

New Animated Login or signup page made by HTML, CSS and JavaScript.

C Program to print multiplication table of any number.

C Language Travel Agency Manager Exercise.

STRUCTURE IN C PROGRAMMING.