Aman
actually the first iteration is for the multiplication of consecutive terms and the second is for continuous multiplication..
Aman
i'm sorry if u didn't understand actually I'm a beginner in CP
r3tr0m
Hey
Pavel
actually the first iteration is for the multiplication of consecutive terms and the second is for continuous multiplication..
about your last pair of loops, I see that if your range is empty (i == j) this is a valid case by the check, multiply will return one (because no iterations will be done inside) and isPerfectSquare will return true for that one is that also expected behavior?
BBB
Hi, I can't solve this exercise in C. I have a string, and I have to identify the substrings made of consecutive numbers, then to calculate their lengh, and print the maximum lengh and the minimun lenght. Here it's the code, I know it's wrong https://pastebin.com/txy1SCSb
Sim run 🏃‍♀️
Hello, I have written two .c and one .h file and I am unable to get the desired result. I don't know where I have gone wrong. May I share the code using pastebin here?
Hima
Hi, I can't solve this exercise in C. I have a string, and I have to identify the substrings made of consecutive numbers, then to calculate their lengh, and print the maximum lengh and the minimun lenght. Here it's the code, I know it's wrong https://pastebin.com/txy1SCSb
You can try following fixes in your code: -you don't need a nested loop, just a single pass is enough -conto is not initialised -min is intialized with 0 for which its value will never change (why?) -the else if statement should be replaced with if for min part(why?)
Anonymous
Are sorting algorithms still effective in the era of 7nm and SSD's
Krishnaa
My vector shows empty while debugging!!!!!!! Help me out please
Jasur Fozilov 🐳
My vector shows empty while debugging!!!!!!! Help me out please
if you don't show your code, nobody can help you
Ravi
My vector shows empty while debugging!!!!!!! Help me out please
maybe you would have not initialized it by size.
Krishnaa
Aman
what is it about
Anonymous
Hello i want a code for get string path of a file in resource (Xamarin.Android) Please help me
Imtiaz
anyone here know spark??
Imtiaz
hadoop??
BBB
The language of problem is in different language and the comment too
Yea, it's Italian, but I have explained the text of the exercise, and the comments just say that it's wrong what I have written
Imtiaz
what function used for sum all the number from a variable using lambda function ?? (in hadoop|| spark)
mukesh
HaiNahi
Anyone creative here?
Anonymous
Anyone creative here?
I was very much earlier but algorithms crushed me
Isaac
Thanks @MissRose_bot
HaiNahi
Made anything creative in past
Anonymous
in the name of creativity all I can imagine is \n \t endl etc. etc.
Anonymous
Made anything creative in past
made a decision tree actually my prized creative program ever
HaiNahi
explain more about your project
HaiNahi
* Rendering Pipeline (complete) * Chess Engine (complete) * Processor Emulator * Applied philosophy on chatroom toxicity * GUI Mechanical solver to form equations and solve them mine ones
HaiNahi
I guess younger creative people especially, need special teachers to learn enough to make something new (grade 7 to above). Also people want to showcase their creative achievements or work in teams. There should be a community of creative people.
mukesh
Why
mukesh
Delete
Anonymous
Hello
Anonymous
hii
Anonymous
#include <iostream> using namespace std; class student { string name; string department; int age; int enroll; public: student(); void print(void) { cout << endl << endl; cout << " The student name is : " << name << endl; cout << " The student department is : " << department << endl; cout << " The student age is : " << age << endl; cout << " The student enroll is : " << enroll << endl; } }; student ::student() { cout << " enter student name : "; getline(cin, name); cout << " enter studnt age : "; cin >> age; cout << " enter student department : "; getline(cin, department); cout << " enter student enrollment number : "; cin >> enroll; } int main() { student s1, s2; s1.print(); s2.print(); return 0; }
Anonymous
output is : enter student name : mr,rex ; enter student age : 10 then it is printing " enter student department " and " enter student enrollment number " both lines at same time so im unable to enter students department
Anonymous
output is : enter student name : mr,rex ; enter student age : 10 then it is printing " enter student department " and " enter student enrollment number " both lines at same time so im unable to enter students department
After cin>>age, put cin.ignore() This happens because when you input age, say 20, and press enter, the input stream contains 20\n. The 20 is read and the \n still remains in the buffer. Since getline reads till \n, the next statement only reads the \n and stops. cin.ignore() discards the next character from the input buffer, which is what we want here.
Md. Sakib
One day Lisa decided to take part in a competition. The rule of the competition is she will be given a tray. The tray will contain some items. Every item will contain a tag and every tag will contain a specific number. Items are sorted in ascending order according to their tag numbers. Lisa will be asked to find out an item with a specific tag number out of the available items. To find out the given item, she needs to search the available items from the tray. If she wants to win the competition, she needs to find out the item within a minimum amount of time. Now, your task is to write a program that will help Lisa to find the given item and display the corresponding complexity in forms of M. (M: the minimum number of rounds the program takes to find out the given item). Input: The first line contains an integer N, the number of items. Second-line contains N integer values denoting the tag numbers of the items. The last line contains a random integer, K only from within the available tag numbers. Output: Display the value of M Sample Input: 6 1 2 3 4 5 6 6 Sample output: 3 Sample Input: 7 3 5 8 9 10 13 19 13 Sample Output: 2
Md. Sakib
can anyone help me to solve this
Dima
It’s outdated and archaic
A.M UMAR
It’s outdated and archaic
Codeblock, Sblimetex or Dev?
Anonymous
#include <iostream> using namespace std; void main(){ cout<<"hello everyone"<< endl; }
BBB
Hi! Why does this print the number in reverse. For example, if I input 3 7, it prints 7 3 https://pastebin.com/mdzTgbZz
BBB
I'm learning C, I'm gonna ask a lot of stupid/basic questions 😅
\Device\NUL
Hi! Why does this print the number in reverse. For example, if I input 3 7, it prints 7 3 https://pastebin.com/mdzTgbZz
You don't even need parameter on input func Your code isn't print number in reverse
\Device\NUL
Change your while to do while do { scanf("%d", &n); } while (n < 0);
BBB
You don't even need parameter on input func Your code isn't print number in reverse
#include<stdio.h> int input(); int main() { int a, b; printf("%d %d\n", input(a), input(b)); return 0; } int input(){ int n; do{ scanf("%d", &n); } while(n<0); return n; } Here it's the output of the terminal (I typed 9 8) ./a.out 9 8 8 9
BBB
Terminal in UBuntu
\Device\NUL
I use Clang with C11 standard
\Device\NUL
Terminal in UBuntu
Doesn't make sense, i ask your compiler, not terminal or OS
BBB
I compile in the terminal of Ubuntu
\Device\NUL
Yea i know, i use GNU/Linux too
\Device\NUL
Ah, i think your compiler is gcc
BBB
Yes
\Device\NUL
Yes
I think that because the program call input(b) first before input(a)
BBB
So it's because the last in is the first out? I think I understand, thank you
Anonymous
So it's because the last in is the first out? I think I understand, thank you
No it is not because of FIFO or LIFO. The standard does not guarantee the order in which arguments passed to a function are evaluated. It could evaluate them in any order.
Vignesh
Hello, Any ideas on how to prevent or counter the integer overflow in function except using the higher oversized integers?
Ajay
In C programming, When we declare a variable as register type the memory allocation is in CPU memory means in register. if the register memory is full the memory allocation is in stack. Then can we find whether the memory allocation is in register or stack at run time only? Waiting for Clarification
CaviarX
🧐
Ajay
🧐
What happened @Caviar_X
klimi
Hello, Any ideas on how to prevent or counter the integer overflow in function except using the higher oversized integers?
https://stackoverflow.com/questions/55468823/how-to-detect-integer-overflow-in-c#55468867
Cipher
Made easy cse premium
CH
Hi. Is anyone out there know on how to display the real time clock and real time date for PIC16F by C?
Ludovic 'Archivist'
In C programming, When we declare a variable as register type the memory allocation is in CPU memory means in register. if the register memory is full the memory allocation is in stack. Then can we find whether the memory allocation is in register or stack at run time only? Waiting for Clarification
Register currently does nothing as part of the C standard. It may have some function with some non portable expansions (like with clang and gcc where you can specify that a variable is stored in a specific register as used here: https://archivist.nekoit.xyz/syscall-for-linux-on-clang/)
Ajay
In C programming, When we declare a variable as register type the memory allocation is in CPU memory means in register. if the register memory is full the memory allocation is in stack. Then can we find whether the memory allocation is in register or stack at run time only? Waiting for Clarification
@QNeko Yes sir I'm using GCC compiler in Linux. I heard that while debugging with GDB we can see the memory where it is located. But I need to see where the memory allocation by the CPU either in register or stack at run time
Strife
Y
Strife
No Just need time