this code is showing me an error which says "Command failed: ./a.out <input.txt". Can you please help me | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

this code is showing me an error which says "Command failed: ./a.out <input.txt". Can you please help me

#include <stdio.h> #include <math.h> int main() { int a, b, sum = 0; scanf("%d", &a); while(a != 0) { b = a % 10; sum += pow(b,3); a = a/10; } printf("%d", sum); }

3rd Apr 2020, 5:45 AM
Somya Sarathi Samal
Somya Sarathi Samal - avatar
5 ответов
+ 1
I wrote it exactly as it is here and it came out normal. You may be missing the return 0; the last one.
3rd Apr 2020, 6:16 AM
Marco
Marco - avatar
+ 1
Lo escribí exacto como está aquí y me salió normal. Puede ser que te falte el return 0; al último.
3rd Apr 2020, 5:57 AM
Marco
Marco - avatar
+ 1
You are welcome.
3rd Apr 2020, 6:20 AM
Marco
Marco - avatar
0
@Marco thank you for replying, but I'm barely able to understand anything. Can you please elaborate this in english.
3rd Apr 2020, 6:11 AM
Somya Sarathi Samal
Somya Sarathi Samal - avatar
0
@Marco thanks a lot
3rd Apr 2020, 6:18 AM
Somya Sarathi Samal
Somya Sarathi Samal - avatar