STRING | Indian Shout

You are here: » Posts for tag STRING

C PROGRAM TO FIND LENGTH OF A STRING

Posted by 0 Responses

/* Write a c program to find the length of a string without using the built-in function  */ #include <stdio.h> void main() { char string[50]; int  i, length = 0; printf("Enter a string\n"); gets(string); for (i=0; string[i] != '\0'; i++) /*keep going through each */ {                                 /*character of the string */ length++;                    ... [ Continue reading... ]

Jun
7
2010

C PROGRAM TO ACCEPT STRING & SUBSTRING AND CHECK SUBSTRING PRESENT IN STRING OR NOT

Posted by 1 Response

/* Write a C program to accept a string and a substring and check if the substring is present in the given string */ #include<stdio.h> #include<conio.h> void main() { char str[80],search[10];     int count1=0,count2=0,i,j,flag; clrscr(); puts("Enter a string:"); gets(str); puts("Enter search substring:"); gets(search); while (str[count1]!='\0') count1++; while (search[count2]!='\0') ... [ Continue reading... ]

May
14
2010
 
Search
Free Email Updates
Get All Latest Updates in Ur e-mail Inbox..

And then confirm your email subcription

Free SMS Alerts
Sponsored Links
Copy Protected by Chetans WP-Copyprotect.