Thursday 28 March 2019

CP: Library function for the string.


Que: Write a program to demonstrate the Library function for the string.

Code:

#include <stdio.h>
void myfunction(char str[]);

int main()
{
    char str[50];
    printf("\n Enter your name : ");
    gets(str);
    myfunction(str);     // Passing string to a function.
    return 0;
}

void myfunction(char str[])
{
    printf("\n Output using my function: ");
    puts(str);

}

Output: 




No comments:

Post a Comment

LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project

  LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project Dear All We will learn how to Connec...