# 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

 Franz Schmidt · August 29, 2015 Not sure if it's exactly what you want but there we go:http://textuploader.com/allydAnd a little suggestion by the way: The reason why you should use a for loop is to keep your program dynamic. In your case you wouldn't even need any loop cause there are only two numbers but imagine if you want to input 1000 numbers instead of 2 numbers anytime? You would need to change your whole program to make this work and in my opintion you would only need to change one number  So keep in mind the dynamic of a program is one of the most important things in programming. Rehman . · August 29, 2015 @C student you are close Rehman . · August 29, 2015 @C student you are close c student · August 29, 2015 if (input < = 9){ cout<>input[0];you must switch it to cin>>input;andif (input<=9)etc
• 1

## C++

118,642 followers