1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
| #include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
int n,i;
struct student
{
int len;
char name[100];
}std[100];
void main()
{
cout<<"\n ___________________________________________________________________\n";
cout<<"\n FIND REVERSE OF UR FRIENDS NAMES AND LENGTH OF HIS\HER NAME\n";
cout<<"ENTER A LIMIT THAT HOW MANY STUDENTS NAME U WANTS GET TO BE CALCULATED\n";
cin>>n;
void read();
void calculate();
void display();
read();
calculate();
display();
getch();
}
void read()
{
cout<<"\n ___________________________________________________________________\n";
printf("\n ENTER NAME %d NAMES \n",n);
for(i=0;i<n;i++)
{
scanf("%s",&std[i].name);
}
}
void calculate()
{
for(i=0;i<n;i++)
{
strupr(std[i].name);
strrev(std[i].name);
std[i].len=strlen(std[i].name);
}
}
void display()
{
for(i=0;i<n;i++)
{
printf("\n %s : %d",std[i].name,std[i].len);
}
}
|