Showing posts with label Array Of String. Show all posts
Showing posts with label Array Of String. Show all posts

Monday, 29 October 2012

Program Of Reverse String In C++

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
 
main()
 
{
 
clrscr();
 
char x[20];
 
int l;
 
//cout<<"Enter String=";
 
//cin>>x;
 
gets(x);
 
reverse(x);
 
getch();
 
}
 
{
 
int p=0,i;
 
for(i=0;a[i]!='\0';i++)
 
{
 
p++;
 
}
 
{
 
cout<<a[i];
 
}
 
}

Program Of Sub String In C++

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
 
main()
 
 {
 
clrscr(); 
char x[20];
 
int l; 
puts("Enter string=");
 
gets(x);
 
getch();
 
}
 
void substr(char a[20]) 

{
 
int beg,end,i;
 
cout<<"Enter Beging & Ending Number=";
 
cin>>beg>>end;
 
{
 
cout<<a[i];
 
}
 
}

Saturday, 11 February 2012

Program Of Array Of String In C


#include<stdio.h>
#include<conio.h>

          struct student         // Structure Delaration
{
int rollno;
char name[20];
int marks;

} ;
main()
{
int i;
clrscr();
student s1[3];       // Object(s1[]) Array  of  Structure  is Declare
for(i=0;i<3;i++)
{
printf("Enter rollno=");
scanf("%d",&s1[i].rollno);     // Access of  Structure
printf("Enter Name=");
scanf("%s",s1[i].name);
printf("Enter MArks=");
scanf("%d",&s1[i].marks);
}
printf("\n==============  REcord of Student================\n");
for(i=0;i<3;i++)
{

printf("\n Roll Number= %d",s1[i].rollno);
printf("\n Name= %s",s1[i].name);
}
getch();
}