C program for Enter and display string using getchar and putchar

Thursday, 6 March 2014

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char nandan[20];
char c;
int i,n;
clrscr();
printf("Developed By: Nandan Kr. Kushwaha\n\n");
printf("Enter the size of the string\n");
scanf("%d",&n);
printf("Enter the string\n");
for(i=0;i<=n;i++);
{
c=getchar();
nandan[i]=c;
}
printf("\n String is:");
for(i=0;i<=n;i++)
{
putchar(nandan[i]);
}
getch();
}

OUTPUT:-



1 comment

  1. This is my very first time that I am visiting here and I’m truly pleasurable to see everything at one place.
    c++ programming tutorial

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...
Related Posts Plugin for WordPress, Blogger...
 

Most Reading

Labels