need a help

i tried so hard to find where is my logic error here , it is give me the same character i put .without scape the e or a

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>
using namespace std;

int main()
{
char arr[50];
cout<<"Enter please the value of elements\n";
	for(int j=0;j<50;j++){
		cin>>arr[j];
		
if(arr[j]=='a'&& arr[j]=='e')
	cout<<(arr[j]=='0');
else
	cout<<arr[j];
	}




system("pause");
return 0;
	}
1
2
(arr[j]=='a'   &&    arr[j]=='e')
               ^^


arr[j] cannot be 'a' and 'e' at the same time. Try || instead of &&.
I have a question i need help

1\write a c++ program to count no of letters in a given line

2\write a c++ program to calculate employee salary
validation : for the salary less than 5000
a. HRA IS 15% OF BASIC salary
b. DA is 35% of basic salary
for salary above 5000
a HRA is 5% of basic salary
b. DA is 25% of basic salary
@faisal00:

1. Please open a new topic for a new question.

2. There you may want to give us some more details of your question:
- Do show us your current lines of code.
- Describe the input and expected and the real behavior and output.
- ...
I'm sorry I'm new here
thank you tcs acctuly i found my self such as stupid cus you right how it will be e and a in the same time ,anyway thank you .
@faisal00 dont steal someone's thread.
Topic archived. No new replies allowed.