Похожие чаты

#Include <iostream> void getValueFromUser() { std::cout << "Enter an

integer: "; int input{}; std::cin >> input; } int main() { getValueFromUser(); // Ask user for input int num{}; // How do we get the value from getValueFromUser() and use it to initialize this variable? std::cout << num << " doubled is: " << num * 2 << '\n'; return 0; }

10 ответов

21 просмотр
پدرام- Автор вопроса

I run this but get error Error(s): Process killed, because it ran longer than 10 seconds. Is your code waiting for keyboard input which is not supplied? None 5.336123 3928

format it properly, it's unreadable. Or use a pasting website

پدرام- Автор вопроса
Manav | avoid unnecessary messaging me
format it properly, it's unreadable. Or use a past...

#include <iostream> void getValueFromUser() { std::cout << "Enter an integer: "; int input{}; std::cin >> input; } int main() { getValueFromUser(); // Ask user for input int num{}; // How do we get the value from getValueFromUser() and use it to initialize this variable? std::cout << num << " doubled is: " << num * 2 << '\n'; return 0; }

پدرام
#include <iostream> void getValueFromUser() { st...

just use a pasting website, it'a better than pasting it here

پدرام
.

where are you running that code? There's a few things that are wrong with what you have programmed which has nothing to do with the error you get 1. you aren't returning the input you get, so num has the value 0.

you forgot to enter the values then, there should be a section where you can input values, can you send me the link to the online compiler?

Kishore
Could you plz refer some books/tutorial for c?

Modern C in the pinned message is a good book to follow.

Похожие вопросы

Обсуждают сегодня

#include <stdio.h> #include <stdlib.h> #include <time.h> void mass_first_generate(int mass[5][7]) {     for (int N = 0; N < 5; N++) {         for (int A = 0; A < 7; A++) {   ...
Чувак
6
https://www.linkedin.com/posts/ugama-benedicta-kelechi-codergirl-103041300_mobiledevelopment-fluttertraining-handsonlearning-activity-7263445699227254784-IdHB?utm_source=share...
CoderGirl
16
Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
VIP-397 BNBx Oracle implementation upgrade Summary This proposal, if approved, will upgrade the implementation of the BNBx Oracle contract on Venus from version 1 (V1) to v...
Venus Announcements
2
like, question: int b = 99999; is this valid and predictable C?
Ludovic 'Archivist' Lagouardette
15
Помогите пожалуйста. Делаю систему плагинов. Проблема сейчас в такая: плагины загружаются в основном потоке. FLibHandle := SafeLoadLibrary(FFileName) Но нужно еще выполнить фу...
Илья 🤣
10
Ну вот просто даже давайте вот как. Какой нибудь конкретный кейс, можете в пример привести, где бч работает и приносит прикладную пользу, а не просто что бы было? Не крипту.
Alexander Andreev
22
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
Карта сайта