#include<stdio. h>
#include<stdlib .h>
void main()
{
struct army
{
char name[20];
char adress[50];
char age[10];
char contact[20];
char height[10];
};
struct army army[50];
int i,n;
printf("Enter the number of army person \n");
scanf("%d",&n);
printf("ENTER THE ARMY MAN DETAILS \n\n");
for(i=1;i<=n;i+ +)
{
printf("Enter the name of army person \n");
scanf("%s",army[i].name);
printf("Enter the adress of army person \n");
scanf("%s",army[i].adress);
printf("Enter the age of army person \n");
scanf("%s",army[i].age);
printf("Enter the contact of army person \n");
scanf("%s",army[i].contact);
printf("Enter the height of the army man \n");
scanf("%s",&arm y[i].height);
}
for(i=1;i<=n;i+ +)
{
printf("The army man name is %s \n",army[i].name);
printf("The army man adress is %s \n",army[i].adress);
printf("The age of army man is %s \n",army[i].age);
printf("The contact number of army man is %s \n",army[i].contact);
printf("The army man height is %s \n",army[i].height);
if(army[i].height < 200)
printf("He is eligble to join army \n");
else
printf("He is not eligible \n");
}
}
IN THIS I AM GETTING43 19 E:\suresh\army. c [Warning] comparison between pointer and integer
HOW TO OVERCOME FROM THIS PLEASE HELP ME..!!! TO SOLVE THIS
#include<stdlib .h>
void main()
{
struct army
{
char name[20];
char adress[50];
char age[10];
char contact[20];
char height[10];
};
struct army army[50];
int i,n;
printf("Enter the number of army person \n");
scanf("%d",&n);
printf("ENTER THE ARMY MAN DETAILS \n\n");
for(i=1;i<=n;i+ +)
{
printf("Enter the name of army person \n");
scanf("%s",army[i].name);
printf("Enter the adress of army person \n");
scanf("%s",army[i].adress);
printf("Enter the age of army person \n");
scanf("%s",army[i].age);
printf("Enter the contact of army person \n");
scanf("%s",army[i].contact);
printf("Enter the height of the army man \n");
scanf("%s",&arm y[i].height);
}
for(i=1;i<=n;i+ +)
{
printf("The army man name is %s \n",army[i].name);
printf("The army man adress is %s \n",army[i].adress);
printf("The age of army man is %s \n",army[i].age);
printf("The contact number of army man is %s \n",army[i].contact);
printf("The army man height is %s \n",army[i].height);
if(army[i].height < 200)
printf("He is eligble to join army \n");
else
printf("He is not eligible \n");
}
}
IN THIS I AM GETTING43 19 E:\suresh\army. c [Warning] comparison between pointer and integer
HOW TO OVERCOME FROM THIS PLEASE HELP ME..!!! TO SOLVE THIS
Comment