Anonymous
Kk Tnx for accepting me in ur group
Anonymous
Probably how many months it ll take to learn c language can anyone answer me
Anonymous
Probably how many months it ll take to learn c language can anyone answer me
C Basics can be learned in one day or one week if you are new.
Anonymous
Yeah I'm a just beginner
Anonymous
Where should i start bro
Anonymous
loop input output
Anonymous
functions structures,arrays,pointer
Anonymous
Well these are the main basics right
Anonymous
yes
Anonymous
than try to difficult things like manipulate data with FILE
Anonymous
Kk bro thanks for answering
Anonymous
np bro and i give you an advice for an beginner program an game code like snake
Anonymous
you will see that you are ready for another stuff
AJAY
When we check the size of a function using sizeof(), we always get 1 byte. Why?
Anonymous
Anyone knows
https://stackoverflow.com/questions/12259101/why-is-the-size-of-a-function-in-c-always-1-byte
Anonymous
Given the following array [10,5,3,9,22,24,28,27].write a program to sort this array using merge sort
Anonymous
Given the following array [10,5,3,9,22,24,28,27].write a program to sort this array using merge sort
#include <stdio.h> int partition(int a[], int beg, int end); void quickSort(int a[], int beg, int end); void main() { int i; int arr[8]={10,5,3,9,22,24,28,27}; quickSort(arr, 0, 7); printf("\n The sorted array is: \n"); for(i=0;i<8;i++) printf(" %d\t", arr[i]); } int partition(int a[], int beg, int end) { int left, right, temp, loc, flag; loc = left = beg; right = end; flag = 0; while(flag != 1) { while((a[loc] <= a[right]) && (loc!=right)) right--; if(loc==right) flag =1; else if(a[loc]>a[right]) { temp = a[loc]; a[loc] = a[right]; a[right] = temp; loc = right; } if(flag!=1) { while((a[loc] >= a[left]) && (loc!=left)) left++; if(loc==left) flag =1; else if(a[loc] < a[left]) { temp = a[loc]; a[loc] = a[left]; a[left] = temp; loc = left; } } } return loc; } void quickSort(int a[], int beg, int end) { int loc; if(beg<end) { loc = partition(a, beg, end); quickSort(a, beg, loc-1); quickSort(a, loc+1, end); } }
Anonymous
This isn't merge sort it's quick sort can I go with this
Anonymous
https://t.me/programminginc/283193
klimi
This isn't merge sort it's quick sort can I go with this
what do you think? you have been asked for merge sort, and you even said it isn't merge sort...
klimi
check the rules lol, rule 3
well, they posted "their" code
Anonymous
well, they posted "their" code
heh, why is their in air quates?
Anonymous
m
Anonymous
wrong chat
olli
heh, why is their in air quates?
because it's probably taken from the internet, this pretty similar looking code has been posted five years ago. additionally, why would you end up implementing quicksort when trying to get mergesort? https://ideone.com/PgVXbW
Good
I tried to create one simple shared library and link it to the caller function.Its working fine but If I add default argument to the library function compiler is throwing main.cpp:(.text+0x3a): undefined reference to `add(int, int, Status)'
Good
Please find the code:https://dpaste.org/Urst
Good
Without default argument code is working
Good
Found the issue the definition also should have the default argument parameter
Georges
Hello how can i write a c++ function that calculates sin(x) using maclaurin series approximation
Nameful
Hello how can i write a c++ function that calculates sin(x) using maclaurin series approximation
Look up now Maclaurin series approximation works and implement that as C++
Georges
I tried but i am not getting the excepted answer
🇵🇭🇷🇺
Hello, can I ask you guys a question? Which system/program is more difficult to create, Ecommerce or student portal?
Pavel
Hello, can I ask you guys a question? Which system/program is more difficult to create, Ecommerce or student portal?
E-commerce for sure, if we're talking about real-life stuff, not about student projects that going to be thrown away in the end
Anonymous
Write a program that inserts an element at the middle and end of an array. User should be given the option to select the value to be entered and the position for the value in the array. Please help me 😒
Anonymous
Show your work first.
#include<iostream> using namespace std; int main() { int arr[6], i, elem; cout<<"Enter 5 Array Elements: "; for(i=0; i<5; i++) cin>>arr[i]; cout<<"\nEnter Element to Insert: "; cin>>elem; arr[i] = elem; cout<<"\nThe New Array is:\n"; for(i=0; i<6; i++) cout<<arr[i]<<" "; cout<<endl; return 0; }
Anonymous
This only inserts at the end of... 😒
Ravi
This only inserts at the end of... 😒
It will end at array as, you should do arr[size/2] = element , also, you bave to shift the right side elements by 1 step.
Ravi
Sorry, you should try, google the subproblems, like how to shift an array by one, how to calculate mid point of an array. It will be good for you
S__R
i use unordered map to store array elements like this method it store the locations of array and its index how this storing elements and its index can someone explain the diffrence between mss[nums[i]]++ and this unordered_map<int,int> mss; mss[nums[0]] = 0; mss[nums[1]] = 1; mss[nums[2]] = 2; mss[nums[3]] = 3; mss[nums[4]] = 4;
mvmt
although I'm not sure about the second one
King
I agree
Anonymous
#include <stdio.h> #include <stdlib.h> int main() { int s,a; printf("Enter your sallery in USD: "); scanf("%d",&s); if(s < 500) a = s(1 + 5/100); if(s < 1000 && s>= 500) a = s(1 + 10/100); if(s >= 1000) a = s(1 + 15/100); printf(" your new sallery is %d USD",a); return 0; } Help me to find errors in this program
Anonymous
it's still now working
Anonymous
## Rules #pinned * You are not entitled to an answer, getting angry about not answered questions will get you warned. * Not checking your problem in google (or any other search engine) first will get you a warn. * Asking to solve an assignment/test/whatever without trying it first yourself will get you a warn or will get you BANNED. We won’t write a code for you, but we can push you forward and suggest something. * Before posting a long code snippet think twice and read the Resources section below. * No “best book” or “best youtube channel” requests, use /get cbook and /get cppbookguide chat commands. * No “best ide” requests, use /get ide chat command to see the suggestions. * Asking for something that is in the pinned message right after joining WILL GET YOU BANNED. * C/C++ discussion preffered (assembly also allowed), asking about other languages (or groups for other languages) right after joining will get you BANNED. * Reverse enginnering, hacking and related topics are allowed, but asking to hack facebook, instagram, etc. is NOT allowed. Also if you ask "how to become a hacker" and obviously have zero knowledge on anything related to that you may get warned or banned. * Legitimate requests for help on code and programming questions are welcome. A request is considered legitimate if it describes your problem, what you've done so far and what went wrong. Requests such as "write my program" or "do my homework" are never considered legitimate. Asking not legitimate questions will result in a warn or ban. See https://stackoverflow.com/help/mcve on how to write good questions. * Asking for book recommendations is ok, but "pls give pdf book" is not allowed, find books by yourself. Posting illegally copied books (or links to those books) is also not allowed and will get you BANNED. * Only English language is allowed, if you speak shitty English or don't understand anything in English YOU WILL BE BANNED. * A little bit of programming related memes, jokes, shitposting are allowed. * NSFW content (porn, nudity, etc.) is not allowed. * Spamming/advertising (job posts are also ads, so ask an admin before posting) will grant you a warning or an immediate ban if you do it right after joining. * Religion, politics and ideological topics are forbidden. * Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed. * If you encounter a problem, while using dev C++ or turbo C/C++, you will not be helped, use another more modern IDE. * Don't post compiled executables, that is obviously a security risk. * Personal messages without asking beforehand are not allowed. * If you want to post a link or some article in this chat you will need an admin approval first ## Resources C/C++ group India: http://t.me/c_cpp_india About asking good questions: * [English](http://www.catb.org/esr/faqs/smart-questions.html) * [Translations](http://www.catb.org/esr/faqs/smart-questions.html#translations) For posting long code snippets: * [GitHub Gist](https://gist.github.com) * [Ubuntu Paste](https://paste.ubuntu.com/) * [Pastebin](https://pastebin.com) ## Reports If you notice any forbidden content, please use the /report command while responding to the offending post to report it to the admins.
Ok
𝕱𝖗𝖔𝖟𝖊𝖓
I'm having doubt in c programming
𝕱𝖗𝖔𝖟𝖊𝖓
I have one question,
𝕱𝖗𝖔𝖟𝖊𝖓
Write a program in C programming to swap two values without using third variable. Input must be taken from user.
𝕱𝖗𝖔𝖟𝖊𝖓
Help me your solve this.. 🙏
Andrey
Give us your code pls
𝕱𝖗𝖔𝖟𝖊𝖓
Mark
/get cppbookguide
klimi
Help me your solve this.. 🙏
What's the problem you can't solve?
Anonymous
@K11M1
klimi
@K11M1
That's a assignment statement, not the problem where they got stuck...
Anonymous
That's a assignment statement, not the problem where they got stuck...
indeed, but that's what they're asking for heh
klimi
indeed, but that's what they're asking for heh
That's just the assignment statement, not the question, asking for help in something :)
Me
Write a program in C programming to swap two values without using third variable. Input must be taken from user.
#include<stdio.h> int main() { int a,b; printf("Enter two numbers \n"); scanf("%d%d",&a,&b); printf(" before swap %d, %d\n",a,b); a=a+b; b=a-b; a=a-b; Printf("after swap %d, %d\n",a,b); return 0; }
𝕱𝖗𝖔𝖟𝖊𝖓
#include<stdio.h> int main() { int a,b; printf("Enter two numbers \n"); scanf("%d%d",&a,&b); printf(" before swap %d, %d\n",a,b); a=a+b; b=a-b; a=a-b; Printf("after swap %d, %d\n",a,b); return 0; }
I did this question, yesterday. Even step was same. The only thing that i was unable to do was dry run. I was not getting ans in dry run. But now it's done. Thanks bro.
Φ ☭
/get cbook
Roshan
car::setvariable(string a, string s, int d) \\ no declaration matches { name = a; cartype = s; max_speed = d; } Error here You placed a comment in between a function definition
Anonymous
To show you the error I delete my code to post it with link
Anonymous
I get an error messages 'no declaration matches' when I want to put my class in separate file https://linkode.org/#Nz7dju6QUBbAqLIWRYrP04
Anonymous
I see an error when I return int with string return type but this not the main problem.
Roshan
Cars - Pastebin.com https://pastebin.com/1FchNe0F
Roshan
I see an error when I return int with string return type but this not the main problem.
Here... 1. You didn't write the type specifiers outside class 2. Function name inside class is gettype() and you had used cartype() (which was used as a variable in private)