0
#include <iostream>
#include<vector>
using namespace std;
int main() {
    int N;
    cin>>N;         
    int count=0;
    vector<int>v1(N);
    vector<int>v2(N);
    for(int i=0;i<2;i++)
    {
        int t1,t2;
        cin>>t1>>t2;
        v1.push_back(t1);
        v2.push_back(t2);
    }

I think only this piece of code has the problem


I want to increment and print the value of count but its not working.Is there any problem while dividing two integers and assigning it into float type var or something else.

    for(int i=0;i<v1.size();i++)   
    { 
        float x=(v1[i]/v2[i]);                  
        float y=(v1[i]/v2[i]);      
        if(x>=1.6 && y<=1.7)
        {
            ++count;
        }
    }
    cout<<count;
    return 0;
}
  • 3
    "its not working" is not a proper problem description. please give example input and expected and actual output – codeling Apr 14 '22 at 11:45
  • oh, and welcome to Stack Overflow (SO)! Please read [the help pages](http://stackoverflow.com/help), take [the SO tour](https://stackoverflow.com/tour), read [How to Ask](https://stackoverflow.com/questions/how-to-ask), as well as [this question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – codeling Apr 14 '22 at 11:46
  • Note that `3 / 5 = 0`. – Evg Apr 14 '22 at 11:47
  • 1
    As a side note see [Why is "using namespace std;" considered bad practice](https://stackoverflow.com/questions/1452721) – codeling Apr 14 '22 at 11:47

0 Answers0