Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

What will be the values of variables p, q and i at the end of following loop? int p = 5; int q = 18; for(int i=1;i<5;i++) p++; --q;

Energetic Elephant answered on July 16, 2021 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • int a=10,b=20,c=30; int x,y; x=(a,b,c); y =a,b,c; Find the values of x and y ? Output x=30 Y =10
  • Int a ,b,z; a=1;b=4;while(a<b) { a=2*a; b=b 1; } z=b;
  • Does int *p=&x; is same as these two statements(int *p; p=&x; ) ?
  • Int main ( ) { int i,n; cin>>n; i=n; while(i>=1) { i=i+5; i=i-6; } }
  • Int a ,b,z; a=1;b=4;while(a<b) { a=2*a; b=b 1; } z=b;
  • int a =0, b =10, c = 19; a = - - c % b++;
  • 28.What is the output of the following C++ fragment code? int a = 6, b = 8; int x = 2, y = 4; int c = (x > y? (a--, x) (b--, y)); cout<<"a= "<<a; cout<<" b= "<<b; cout<<" c= "<<c; O a. a = 5 b = 7 C = 2 O b. a = 6 b = 7 C = 4 O c. a = 6 b=8 C = 4 O d. a =
  • 28.What is the output of the following C++ fragment code? int a = 6, b = 8; int x = 2, y = 4; int c = (x > y? (a--, x) (b--, y)); cout<<"a= "<<a; cout<<" b= "<<b; cout<<" c= "<<c; O a. a = 5 b = 7 C = 2 O b. a = 6 b = 7 C = 4 O c. a = 6 b=8 C = 4 O d. a =
  • int solution(int n) { // your code here int result = 0; if (n < 0){ return 0; } else { for (int i = 0; i < n; i++){ if (i % 3 == 0 || i % 5 == 0){ result = result + i; } } } return result; } give me the most opt
  • Int a ,b,z; a=1;b=4;while(a<b) { a=2*a; b=b 1; } z=b;

  • What will be the values of variables p, q and i at the end of following loop? int p = 5; int q = 18; for(int i=1;i&lt;5;i++) p++; --q;

    0
    Popularity 1/10 Helpfulness 1/10 Language cpp
    Source: Grepper
    Tags: c++ int q variables
    Link to this answer
    Share Copy Link
    Contributed on Jul 16 2021
    Energetic Elephant
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.