Tuesday, February 2, 2016

Interesting C String Processing Program

//Enter more than 10 characters and see the output.

#include<stdio.h>
int main()
{
char str[50],str1[10];

int i;
gets(str); //Enter more than 10 characters

for(i=0; i<10; i++)
str1[i]=str[i];

puts(str1); //You will get surprising output.
 return 0;
}

No comments:

Post a Comment