ברני
Might be. Do you have any suggestion to fix it?
Cancel the for j that summons the 2d array, try to see that everything is right, and maybe try to give return a value
ninja
/warn
Anonymous
#include <stdio.h> void my_function1 (int a) { int b; for (b=0; b<a; b++) printf ("Hello world! \n"); printf ("I accept something\n"); printf (" but return nothing\n"); } void main (void) { int a; printf ("Type a number : "); scanf ("%d", &a); my_function1 (a); } Can you guys explain the output error?
MONSTER
/warn
Roshan
Hello, There's a question which asks us to find whether a string is actually a string or number or variable ( contains both characters and digits ). The problem is I've the code but somehow it's not working for the last test case. Please find the test case and this is my code. Input: First line of input contains Test cases Second line takes in two inputs, the length of string and the string Output: String Number Variable etc...
Roshan
Please find the test case - Pastebin.com https://pastebin.com/M9EYMTtr
Roshan
Change void main to int main
Would you please see my code 😅😅
Roshan
What about characters like underscore
Can I show a screenshot of the problem in DM?
Sneha
Anonymous
can anybody go to fix this bug : https://sourceforge.net/p/codeblocks/tickets/805/
Z
what is the error in this ? I guess its not syntactical error
Z
printf("Enter the 5 digit number"); int num; scanf("%d", num); int n1=num%10; int n2=num-n1; int n3=n2%10; int n4=n2-n3; int n5=n4%10; int n6=n4-n5; int n7=n6%10; int n8=n6-n7; int n9=n8%10; int sum=n1+n3+n5+n7+n9; printf(" The sum of the digits is %d", sum);
Anonymous
Hello, I'm just starting with the C language. Can you suggest a simple to use IDE in C language?
Z
If you are printing sum of digits of the input, that is probably not the right way
why not ? the question specifically stated to do so using modulo operator
Apk
Modulo is fine....but after that you won't do the subtraction
Sneha
Modulo is fine....but after that you won't do the subtraction
Yeah you do divide the number by 10 since you already included the last digit
Z
Try it on 12
I have written that program specefically for 5 digit numbers only ..why is it not running for 5 dig nos?
Apk
I have written that program specefically for 5 digit numbers only ..why is it not running for 5 dig nos?
The problem is same....when you subtract the first time, you are making the number a multiple of 10 so after that the modulus will always give 0
Apk
It should be the same for any number of digits
Igor🇺🇦
@unterumarmung is that your argument why Eclipse is bad? Removing comments? 😂 So mature.
Anonymous
So how about Dev-C++?
David
notepad-like IDE
David
sublime text better
Anonymous
@unterumarmung is that your argument why Eclipse is bad? Removing comments? 😂 So mature.
I removed flood Is your argument that Eclipse is good that no one knows how to use it? :) Don't you think it's a sign that it's not really good?
David
Eclipse good, but only 1% of users knows that it can-be expanded by plugins
Anonymous
Eclipse good, but only 1% of users knows that it can-be expanded by plugins
I use Eclipse, with python/pyside, and i am very Happy
#define CLEAR_BUFFER while ( getchar ( ) != ’ \n ’ )
JHUICY
i need help to a solution here.pls dm me if you can help me with some work.
christian
@Roshan_Pradhan1098 unfortunately I don't code in C++ I code in C and python a little bit
christian
JHUICY
can you help me program in c++
christian
can you help me program in c++
Sorry, I don't code in C++
klimi
can you help me program in c++
What's the problem that you need help?
klimi
klimi
(Thought it is not my to go language)
JHUICY
I have, yes
please pm me so that we can talk
Roshan
please pm me so that we can talk
Provide the problem, maybe someone will help
klimi
please pm me so that we can talk
I dont pm random people
JHUICY
JHUICY
you
klimi
Then you will pm me
JHUICY
can anyone help me with this three questions:
JHUICY
1. Using these values: m = 12, n = 24, p = 6, q = 3, r = 2, s = 4, and t = 1,, show whether the following Boolean expressions evaluate to ‘true’ or ‘false’ : (i) if (m > p) and (q > s) and (r > t) then print true else print false (ii) if (m > n*p) or (q*r < p) or (p > s+t) then print true else print false (iii) if (m/p = r) and (p-q = r) or (p+q = 2*s) then print true else print false
JHUICY
i don't know how to work on it
Roshan
i don't know how to work on it
Make 3 if statements and put those as condition
JHUICY
i hust pmed you let's talk
Roshan
Roshan
Just do it here
JHUICY
Just do it here
this is what i had
JHUICY
Question 1 #include <iostream> using namespace std; int main() { char m=12; char n=24; char p=6; char q=3; char r=2; char s=4; char t=1; int d=12/6; //division int e=6-3; //subtract int a=6+3; //addition string tr= "true"; string fa= "false"; if ((m > p)&&(q > s)&&(r > t)) cout <<" The boolean expressions is: "<< tr; else cout <<" The boolean expressions is: "<< fa; cout << "\n"; cout << "\n"; if ((m > n*p) || (q*r < p) || (p > s+t)) cout <<" The boolean expressions is: "<<tr; else cout <<" The boolean expressions is: " <<fa; cout << "\n"; cout << "\n"; if ((d = r) && (e = r) || (a = 2*s)) cout <<" The boolean expressions is: "<< tr; else cout <<" The boolean expressions is: "<< fa; cout << "\n"; cout << "\n"; return 0; }
JHUICY
i don't know how to do it you give me teps
JHUICY
@Roshan_Pradhan1098hey
Roshan
i don't know how to do it you give me teps
if( (m > p) && (q > s) && (r > t) ) cout << "true"; else cout << "false";
Roshan
Similarly....
Roshan
Wait a min...