# Can any one find the segmentation fault here, much appriciated

 Rehman . · August 28, 2015 Problem Explanation:User should be asked to enter two integers program should check whethere those integers are under 9 and if they are check what that value is and print that alphabetically, e.g if user entered 2 at first so 2 < 9 and we need to print it "two" and print one element next to it in alphabetic as well, coming along if the input is greater than 9  then program should simply print if its even or odd, This thing will be done with the other integer too.Note: They said For loop is necessary to be used i don't know why but i just used it, so ignore that if you think code can be efficient without for.``#include using namespace std;int main(){    int input[2];    for(int i = 0; i < 2; i++)    cin>> input;    int mod = input[0] % 2;    int mod2 = input[1] % 2;    string num[] = {"zero","one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};    for(int i = 0; i < 2; i++)    {        if (input <=9)        {            cout<

## Replies

 Montaser Qasem · August 28, 2015 The input is Array so you can input a value like this : cin>>input[0];you must switch it to cin>>input;andif (input<=9)etc Montaser Qasem · August 28, 2015 here's the code:http://ideone.com/Dte8aB Rehman . · August 28, 2015 Post meant to find the segmentation fault actually,nice try but your code is missing the second element's next number as its less than 9. (not concerned) Montaser Qasem · August 28, 2015 Here you go... if that not correct , then i didn't understand your problem please be more specific.http://ideone.com/Sloxxv c student · August 29, 2015 ``if (input < = 9){ cout<
• 1

## C++

126,623 followers