Anonymous
Show the code, explain what's it about, where is the error, etc.
Write a program that takes a number from the user and display its square.
Anonymous
Write a program that takes a number from the user and displays its most significant digit.
Anonymous
Please answer these two questions.
Alfredo
😂
Anonymous
Most significant digit? #inclide <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int num = (argc > 1) ? atoi(argv[1]) : 0; char str[128]; sprintf(str, "%d", abs(num)); printf("%c\n", str[0]); return 0; } Of course this is not proper C++, it should be done in a C++ way.
coolthought
I have tried Google but came up empty and it point to other languages I know assert() Anyone know what is assert_op()? Is this in-built function in C?
Anonymous
Yes
Anonymous
In C++?
Anonymous
I am talking give me answer in C++
Anonymous
@Harold_McClein
Anonymous
Thanks
Don Peter Joseph
https://pastebin.com/9DnFX36e
Don Peter Joseph
i don't know the problem with this code.It works perfectly when first polynomial has upto 2 terms.But when it has 3 terms , the programs terminates without asking the second polynomial.
Don Peter Joseph
Enter the first polynomial Enter the terms in increasing order of exponents Enter the coefficient and exponent of the term 1:2 3 Do you want to add more terms?1-YES 0-NO 1 Enter the coefficient and exponent of the term 2:4 7 Do you want to add more terms?1-YES 0-NO 0 The entered polynomial is :2(x^3)+4(x^7) Enter the second polynomial Enter the terms in increasing order of exponents Enter the coefficient and exponent of the term 1:4 2 Do you want to add more terms?1-YES 0-NO 0 The entered polynomial is:4(x^2)
Don Peter Joseph
Enter the first polynomial Enter the terms in increasing order of exponents Enter the coefficient and exponent of the term 1:6 0 Do you want to add more terms?1-YES 0-NO 1 Enter the coefficient and exponent of the term 2:7 1 Do you want to add more terms?1-YES 0-NO 1 Enter the coefficient and exponent of the term 3:9 2 Do you want to add more terms?1-YES 0-NO 0 The entered polynomial is :6(x^0)+7(x^1)+9(x^2) Enter the second polynomial Enter the terms in increasing order of exponents
Don Peter Joseph
does anyone knows what is the problem
Anonymous
/purge
Anonymous
Does anyone here have a web programming group? or DB group..?
Anonymous
Xudoyberdi
Thanks
Sure thing.
Martin
It is normal that calling a C++20 coroutine (from a coroutine) leads to dandling references? ex: ``` cppcoro::task<size_t> foo(const std::string& str) { co_return str.size(); } cppcoro::task<> bar() { co_await foo("Hello World"); } // crash ```
Anonymous
Assalam o alikum
Anonymous
i need help in a question of C++
Martin
But ``` cppcoro::task<size_t> foo(const std::string str) { co_return str.size(); } ``` works
Anonymous
Can anyone help me
Anonymous
Can you help me with the Robotic Operating System and 6 DOF Robotic arm
Futuristic Programmer
#imhacker
Jaaa
Don't make this spam 🐥
Anonymous
Think q 🙏
Anonymous
I want learn c programming please help 🙏
Zigzag
Structure is return sizeof() sum all of elements inside him?
Zigzag
Example : struct b{ Int a; Int b; } In this example int = 4B; sizeof(b) = 8byte?
ברני
Hey, sorry for that question if it's not allowed, but can someone send me in privet a group like that but for c#? 🥺
Engineer
I want learn c programming please help 🙏
https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-087-practical-programming-in-c-january-iap-2010/
Anonymous
Hi I've a question. When learning the nested loops is enough? I mean, i'm learning nested loops and i don't know when it's enough?
Jaaa
2d arrays concept uses nested loops 🐥
Xudoyberdi
Hi I've a question. When learning the nested loops is enough? I mean, i'm learning nested loops and i don't know when it's enough?
Try exercises or projects where you need to use nested loops, and if you face no problem in using nested loops. Then, it means it is enough for you.
Xudoyberdi
🅆🄰🄶 𝑥 🄴🄻 🅀🅄🄰🄳🅁🄰
Is there any body who can learbmn me c++ language in private
klimi
Anonymous
Sure, 1btc per hour and we will all teach you
Anonymous
Example : struct b{ Int a; Int b; } In this example int = 4B; sizeof(b) = 8byte?
Not exactly, sizeof(type) gives the memory blocksize of a type obj[1] and includes any alignment padding added by compilier. Use type *array = malloc(len * sizeof(type)); for dynamic arrays.
Jaaa
Which clg bro
klimi
Good Luck to you :) I believe you can do it
klimi
Since you are able to reach out to internet, you have great access to various materials on the internet.
Jaaa
Visit unacedamy u will get
klimi
well... You can not contact your prof?
klimi
what a weird school you are at.... Don't worry... you can still find tutorials online
klimi
I was talking about emails... this is how we talk on our university (or through our web forum)
Dima
depends
Dima
the less questions you ask
Dima
#meta
Igor🇺🇦
Isn't it a question already? 🤔 Do you have question about C\C++ so ask it. Don't ask question about asking questions.
klimi
Just to get things straight... this isn't question... this is a homework assigment
Anonymous
Use functions
Anonymous
And a switch case
Vlad
Use functions
Use force luke
klimi
I am not judging... i am just Saying that questions end up with a question mark like "Have you done the dishes today?"
Andrew
hackerrank.com
Vlad
It is reference to star wars
Vlad
Have you lived under a rock this whole time? :P
Xudoyberdi
Akshay
/get ide
Anonymous
@Rose why?
AHMED
#include<iostream> using namespace std; class gg{ protected: int price; }; class hh : public gg{ public: void setPrice(int x){ price=x;} int getPrice(){ return price ;} }; int main (){ hh myObj; myObj.setPrice(766); myObj.getPrice(); return 0; }
AHMED
Why the output of this program is empty? It should display 766
Alex
what is output? you don`t print anything
AHMED
No output to copy it.
AHMED
Empty page
AHMED
No errors reported
z
return won't print anything.
z
You may want to std::cout it.