Talula
Thanks for this useful information.
It'll be better if you tell us what you plan to do so we might be able to tell you what you could use and get similar or same results.
Anonymous
Can online help me out with this problems 🙄#include<stdio.h> int main() { int i,j,k; for(i=1,j=0,k=3;i<=5,j<=6,k>1;i++,j++,k--); { printf("%d\n%d\n%d\n",i,j,k); } return 0; }
Your for loop has a semicolon after it. So it has no body. Now the condition expression for your for loop is i<=5,j<=6,k>1 Since these are separated by commas, the value of this expression will be the value of the expression k>1. So the expression i++,j++,k-- will be executed till k=1 after which the for loop will terminate. At this stage, i will be 3, j will be 2 and k will be 1 which will be printed out by your printf statement.
Rajputana
It'll be better if you tell us what you plan to do so we might be able to tell you what you could use and get similar or same results.
I was trying to print address of file opened in the RAM only you cleared it but I found @lightness_races_in_orbit also useful which cleared my other doubt. Again Thank you for asking.
Anonymous
#Puzzle #include <iostream> using namespace std; class Test{ public: Test() try : c{nullptr} { //constructor body throw 0; } catch(...){ cout<<"Exception"; } private: char* c; }; int main(){ Test obj; } Why does this code throw an exception in main when the exception has already been caught earlier and the code is not explicitly rethrowing the exception?
Talula
I was trying to print address of file opened in the RAM only you cleared it but I found @lightness_races_in_orbit also useful which cleared my other doubt. Again Thank you for asking.
Why do you need the location of the data stored in the RAM? If you just want to get the data, you can open all the different files using stream.
Rajputana
Anonymous
Hey, welcome
Anonymous
int (*ptr)[3][3]=&arr; int(*p)[3]=(int(*)[3])ptr; Could someone tell me what does it mean?
Anonymous
int (*ptr)[3][3]=&arr; int(*p)[3]=(int(*)[3])ptr; Could someone tell me what does it mean?
I am assuming that arr is defined as int arr[3][3]; ptr is a pointer to a 2 dimensional (there are actually no dimensions in memory) int array i.e. a 3 by 3 array I.e. int[3][3]. It is actually an array of 3 arrays of 3 integers. sizeof(*ptr) will be 36 bytes I.e. 9*4 bytes (assuming ints are 4 bytes long) p is a pointer to an array of 3 integers and it is initialized to refer to the first row of 3 integers in the array pointed to by ptr. Your cast is not legal but it will work on most of the machines out there. It points to &arr[0] You should initialize p with &arr[0] or &(*ptr)[0] or simply arr because arrays decay to a pointer to the type of its elements which in this case will be a pointer to int[3]. sizeof(*p) will be 12 bytes I.e.3*4 bytes
Anonymous
Thanks
Anonymous
Tell me some websites for coding
Anonymous
Tell me some websites for coding
W3school , geeksforgeeks,hackerrank... just google!
Arjun
#include <stdio.h> int main() { // Write C code here int a=0,b=1,n,temp; printf("Enter the number of fibonacci series to be generated"); scanf("%d",n); printf("The fibonacci series is :"); printf("%d%d" , a ,b); for(int i=2 ; i<n;i++){ temp = a + b; printf("%d" , temp); a=b; b=temp; } return 0; }
Arjun
why im getting segmentation fault on this code
Ravi
sorry
Arjun
still its showing segmentation fault
Ravi
& is missing in scanf
Arjun
oh yea thanks btw
'''''''
& is missing in scanf
Happens to me once for two scanf statements
Anonymous
Is there linking frm C++ program to GUI? Which libraries do that? Out of curiosity question
𝗕𝗔𝗛𝗔𝗥‌
pless help😢
Golden Age Of
cptr cannot access the public members of both base class and derived class. - i guess, there are no public modificators for constructors(even default), so probably you wouldnt even be able to create these pointers, also there is no inheritance on the piece of code you dropped
Golden Age Of
I've seen the next question, so ye...
Golden Age Of
Report may be
Talula
Coding what?
Talula
I didn't ask coding in what I asked "Coding what"?
Apk
What exactly do you need help in?
Talula
What do you wanna do using the "coding"?
Apk
I knew that lol
Apk
Don't ask for that here....this group is not for helping in exam.
Talula
I don't understand why people even bother with going into Computer Engineering when they aren't even interested in programming.
Apk
then solve it yourself, why bother others with it?
Anonymous
Come-on
Talula
If you were interested, you would be doing things yourself...
Apk
So what?
Talula
Teach you how to watch a YouTube video on C?
Anonymous
The problem is that u r lazy
Apk
Whatever, read the group rules and don't continue offtopic here.
Anonymous
Yes u do all the works while crying exact at the last time
Anonymous
You can't learn coding in 12h lol
Apk
I don't care about your acceptance. I am not being rude but you should follow the rules of the group you are messaging in, or you will get warned/banned.
m
how to fix error:qml Emulation layer crash in qt designer?
Apk
Quit the offtopic.
Anonymous
!report cancer
Anonymous
Write a function that takes an integer as well as an array as input (assuming the array members are in ascending order) And integrate the number in the presentation so that the ascending order of the presentation is maintained. (Do not use the method of adding to the beginning or end of an array and then rearranging to merge.)
mito
how is std::int_fast#_t and std::int_least#_t where # = 8, 16, 32, or 64 integer types different from other fixed width integer types like std::int#_t and std::uint#_t?
Anonymous
Hello I tried to write a program which displays the next prime number. But it didn't work can please someone help me
Anonymous
how is std::int_fast#_t and std::int_least#_t where # = 8, 16, 32, or 64 integer types different from other fixed width integer types like std::int#_t and std::uint#_t?
They depend on the underlying architecture. Suppose you are working on a system where a byte is 9 bits long (on such a system a char will be 9 bits long). On this system int_least8_t will be 9 bits. Int_fast8_t will be the fastest integer type that can carry out 8 bit integer operations. It can be 9 bits wide or 18 bits wide or even 36 bits wide depending on the underlying architecture. int8_t wont be available on this system.
Anonymous
show your code.
#include <bits/stdc++.h> using namespace std; bool isPrime(int n) { // Corner cases if (n <= 1) return false; if (n <= 3) return true; / if (n%2 == 0 || n%3 == 0) return false; for (int i=5; i*i<=n; i=i+6) if (n%i == 0 || n%(i+2) == 0) return false; return true; }
Anonymous
But I think it is false
Anonymous
More u concrentate on ur homeworks and assignments more u loose ur learning!
Anonymous
A number is given and it displays the next prime number
mito
Yes.
😱 interesting..
Ravi
Simply run a loop k times and print the string in each liop
Ravi
while k-- print s1
Ravi
c or c++
Ravi
zure
Anonymous
How can I do this
To find the next prime number using your IsPrime logic, you just have to check which number greater than the given number returns true when called with isPrime
Anonymous
To find the next prime number using your IsPrime logic, you just have to check which number greater than the given number returns true when called with isPrime
For ex: if your input is 8, then use a while loop to call isPrime on numbers starting from 9 and break out when isPrime returns true. That will be the next prime number
klimi
@sophie5515 and please explain yourself, if you fail to do so I will just remove you
Anonymous
@K11M1 nothing for this?
Anonymous
Can you please help with this A positive intiger is called lucky if its cube ends in 888 Print the n ^th lucky number
Anonymous
/adminlist
Anonymous
Can you please help with this A positive intiger is called lucky if its cube ends in 888 Print the n ^th lucky number
https://www.quora.com/How-do-I-find-kth-number-whose-cube-ends-in-888?share=1 The n-th lucky number will be 250*(n-1)+192