Pavel
Al
if you multiply in a loop by 0 .... the result is always 0
Al
i%2 doesn’t give you even numbers as you expected
Al
sorry i see multiple errors
✙Олег!?
it is multiplied by 5 (
✙Олег!?
5х5=25 25х5=125 .....
correctmaninwrongplace
✙Олег!?
✙Олег!?
Mueen
can any one help me in my exam?
Al
have a try
Pavel
Al
oh yes correct
✙Олег!?
void main()
{
int N;
int arr[5]{ 32, 7, 2, 18, 88 };
int dob;
for (int i = 0; i < 5; i++)
{
if ((i % 2) ==0);
dob = arr[0]*arr[2]*arr[4];
cout << dob << endl;
}
}
✙Олег!?
I marvel at my bad skill
✙Олег!?
to complete the task - 8 hours, a great night
Anonymous
hi how can i do this in C?
13453.61521
i want to print separately 13453 and 61521(without 0.)
✙Олег!?
guys heeelp
✙Олег!?
In a one-dimensional array consisting of N integer elements, calculate: - the product of the elements of the array with even numbers.
Pavel
Bruno
Hi, do you know any c/c++ junior or internship opportunity? I'm really needing a job.
Anonymous
Bruno
Me sir
Tell me more >.<
✙Олег!?
how to combine this code with the previous one
correctmaninwrongplace
if you arent using some gist like the pinned message suggest, i advise to:
1. delete comments, unless extreme necessary
2. add 3x` and 3x` after the code so it be formatted, for example;
int main() {
const int N = 10;
int array[N];
int sum = 0;
/*your other code*/
}
it will help to read your code
correctmaninwrongplace
Hadaward 'Solly'
Anonymous
Improve the above C++ program code that meets the following requirements:
• The improved code must include the Inheritance, Polymorphism (i.e., virtual function), and Template. Under the constraints of meeting these three
requirements, you may add any functionalities that you want. Your scores depend on how perfectly these are reflected.
• The driver function (i.e., main function) needs to be modified to best present your own functionalities and improvements that you implement. (Of course,
the other parts in the above code may also be modified or improved)
• Your code has to be able to WORK in Visual Studio or any other C++ complier WITHOUT ANY ERROR. If it does not work, the score is zero. Hence, the
correct code operation is more important than a long code.
• We will score your code through copying-and-pasting your code to Visual Studio then running it.
Anonymous
can you help to me,bruh?
Anonymous
why do y'all mf always put your entire homework here wishing for someone to do it damn
Anonymous
Xudoyberdi
Please, Winnie Pooh, don't get angry, kids will need you in cartoons
Roshan
Roshan
Yazidi
I've a question regarding "Reference", what is the difference between:
&a = b;
&a = &b;
if a and b are variables.
actually, I didn't get the answer !
Thank you in advance
Roshan
Int &a = b;
Here a is the alias or the reference of b
Roshan
Anonymous
&a is an address
Roshan
Yazidi
so (&a = b;) and (Int* a = &b;)
both of them are same, right?!
I mean they do the same..!
Xudoyberdi
Suka
Yazidi
Yazidi
Roshan
But if you say cout<<a; it prints the memory address of b
Roshan
thanks
Yeah I guess many struggle on this 😅
Suka
Yazidi
Yazidi
thanks a lot
Roshan
Welcome🤗
Roshan
I guess you should save these examples as in my experience I forgot them a lot of time 😂
Anonymous
what is compiler hacking ?
Anonymous
which is first one ?
Roshan
Google it 😅 IDK hacking...
Anonymous
I did .I got some events and some functional programming languages and finally got it is something related to LLVM
Yazidi
Roshan
Yazidi
alright👌🏼🌷
Z
preincrement ++i and post increment i++ can be used interchangeably in while loop ?
olli
Roshan
olli
In for-loop it's same
not necessarily.
#include <stdio.h>
int main() {
for (int i = 10; --i;) { printf("."); }
puts("");
for (int i = 10; i--;) { printf("."); }
}
Roshan
Z
while (++i < 10) first increments i , then checks the condition wheras while (i++<10) first checks conditions then increments i . The essence is the same as ultimately the program has to stop as soon as i=10.
olli
Not the standard way to write. There are 3 arguments
there are three, the last one is empty, which is valid - here with 3 one. There is no "standard" way as this is compliant with both C and C++.
#include <stdio.h>
int main() {
for (int i = 10, x = 1; x; x = --i) { printf("."); }
puts("");
for (int i = 10, x = 1; x; x = i--) { printf("."); }
}
olli
Roshan
Z
Roshan
Roshan