Mohammad
yeah 😅😅 sorry
klimi
so you want sum or a mean?
Mohammad
sum of n And the average
klimi
the sum is easy, just add each number you are printing into the counter, and for the average just divide it by how many numbers you got
Mohammad
How can I add the numbers to counter
klimi
counter = counter + number alternatively short hand is counter += number
𝖳𝗁𝖾 𝖠𝗅𝗀𝗈𝗋𝗂𝗍𝗁𝗆 𝖭𝗂𝗇𝗃𝖺 ⚪♛
Guys i have an interview ongoing
𝖳𝗁𝖾 𝖠𝗅𝗀𝗈𝗋𝗂𝗍𝗁𝗆 𝖭𝗂𝗇𝗃𝖺 ⚪♛
My github account is so low. I need followers to be considered..
𝖳𝗁𝖾 𝖠𝗅𝗀𝗈𝗋𝗂𝗍𝗁𝗆 𝖭𝗂𝗇𝗃𝖺 ⚪♛
Follow me kindly i get this job
𝖳𝗁𝖾 𝖠𝗅𝗀𝗈𝗋𝗂𝗍𝗁𝗆 𝖭𝗂𝗇𝗃𝖺 ⚪♛
https://github.com/ian-dubaideveloper
Mohammad
Write a program that enters n integers, then the program prints the numbers that are multiples of 4 and calculates the arithmetic mean of these numbers that are multiples of 4.
#include<iostream> using namespace std; int main() { int n,i,nn=0,sum=0; cin >> n; for(i=1;i<=n;++i){ if(i%4==0) cout <<i<<endl; sum+=i; } cout <<sum<<endl; nn = n/4; cout <<nn<<endl; return 0; }
Dima
lol what kind of interviewer would watch your followers
klimi
Follow me kindly i get this job
is there anything to follow tho?... I don't think so... this is just a lame way to advertise yourself...
klimi
lol what kind of interviewer would watch your followers
pls sponsor me on github people so interviewers give job
Dima
cool page, but scrolling down and project titles killed me
𝖳𝗁𝖾 𝖠𝗅𝗀𝗈𝗋𝗂𝗍𝗁𝗆 𝖭𝗂𝗇𝗃𝖺 ⚪♛
Denys
Hey, l have program with sorted array and l need to create a graph in Dev C++ using C, so l have a question: Can l draw a line with equal for example 87 than 99 ... using only "graphics.h"
Islom M1Ö
Hello everybody I have a project I did it but have some problems Who can help me please
Trí
Given a file named "numbers.txt" containing multiple lines of text. Each line is a non-negative integer. Write a C program that reads integers listed in this file and stores them in an array (or linked list). The program then uses the fork() system call to create a child process. The parent process will count the numbers of integers in the array that are divisible by 2. The child process will count numbers divisible by 3. Both processes then send their results to the stdout. For examples, if the file "numbers.txt" contains the following lines After executing the program, we must see the following lines on the screen (in any order)
Trí
someone help me with this sentence
Antasya Dania
Hi do you guys know what to use if i want to input multiple inputs and display the inputs in one output?
Antasya Dania
For c program
PIZZA
lyk this you can do it
Pknatic
/* According to the Gregorian calendar, it was Monday on the date 01/01/01. If any year is input through the keyboard write a program to find out the day on 1st January of this year. */ #include<stdio.h> int main() { int yr,day,normal_days,leap_days;/**/ printf("Enter the year = "); scanf("%d",&yr); normal_days=(yr-1)*365;/*we use -1 because entered year is not completed their 365 days*/ leap_days=((yr-1)/4+(yr-1)/400)-(yr-1)/100;/*As per rule which year fully devided by 4 and 400 is a leap year and which not devide is not a leap year*/ day=normal_days+leap_days+1;/* we enterd +1 because we want to the day of 01/01/YEAR.*/ day=day%7; /*We need Remainder For Identify the day*/ if (day==1) { printf("The fisrt day of the year %d = Monday ",yr); } if (day==2) { printf("The fisrt day of the year %d = Tuesday ",yr); } if (day==3) { printf("The fisrt day of the year %d = Wednesday ",yr); } if (day==4) { printf("The fisrt day of the year %d = Thursday ",yr); } if (day==5) { printf("The fisrt day of the year %d = Friday ",yr); } if (day==6) { printf("The fisrt day of the year %d = Saturday ",yr); } if (day==7) { printf("The fisrt day of the year %d = Sunday ",yr); } return 0; } koi bta skta hai galti kya hai ?
Pknatic
Is it a hackerrank ques?
no it's a book's qsn From let us c
Pknatic
totally understandable, the last sentence even more!
run this code and please tell me why it is not print the output of 2090 or above years
PIZZA
as much as I can understand the output will be only one specific print function
Ayushi Gupta!!😼
Hey ..is there anyone who's giving codechef contest?
Pknatic
why not using else if?
coz there are many conditions
Jose
run this code and please tell me why it is not print the output of 2090 or above years
you can use godbolt.org to check the code or use onlinegdb.com to check why the code doesn't work, for example
Jose
coz there are many conditions
a switch/case will be better, instead of so many concatenated ifs
Ayushi Gupta!!😼
will be yet grinding
Can I share a problem here? 🥲
PIZZA
coz there are many conditions
but out of all condition you want only one output ?
Pknatic
PIZZA
else if*
Ayushi Gupta!!😼
DMing you guys ..cuz media sharing isn't allowed here
PIZZA
else if*
use this brother
Pknatic
use this brother
ok bro i'll check
Melbgm
guys i am trying to multiply 2 sparce matrices in c language but the algorithms which i found got failed where can i find an algorithm or code for it in c language ?
Javier
Hello, I need to use a list in C, does anyone have an implementation of one or know of a library?
Antasya Dania
Hi can anyone help me why my totalcost in payment booking does not match with what i entered?
Antasya Dania
and what should i use to display all the roomtype ive entered
Islom M1Ö
Hello everybody I have a project I did it but have some problems Who can help me please
https://hastebin.com/inegiroxid.cpp Here is my code Can someone help to solve errors In the program I should to add 5 people but in the program it ends after 4th
Anonymous
my c++ opration redis i get this error
Anonymous
/usr/bin/ld: CMakeFiles/redisproj.dir/redis2.cpp.o: in function `main': /home/diesel/Desktop/code/redis_demo/redis2.cpp:9: undefined reference to `redisConnect' /usr/bin/ld: /home/diesel/Desktop/code/redis_demo/redis2.cpp:11: undefined reference to `redisFree' /usr/bin/ld: /home/diesel/Desktop/code/redis_demo/redis2.cpp:16: undefined reference to `redisCommand' /usr/bin/ld: /home/diesel/Desktop/code/redis_demo/redis2.cpp:18: undefined reference to `redisFree'
Anonymous
how solve this error, help, help
Anonymous
ah, i alredy solve
Anonymous
.cpp:10:9: error: no matching function for call to ‘RedisTool::init()’ hi bro, i get this error, hepl me
scar tissue
I spent several hours pondering on what seems like a roadblock now. I want to fill container with objects generated in for loop. Is there a way I can fill it with anonymous objects as I iterate through? https://learn.microsoft.com/en-us/cpp/cpp/new-operator-cpp?view=msvc-170#initializing-objects-allocated-with-new this article suggests that I can in fact create anonymous object and then create a pointer that would point to it. I tried implementing it in my code, but I receive a compile time error: no appropriate default constructor available. I got that error before, it tries to initialize an object and use a constructor parameter as it's name. vector<GiftCard> v(gcInfo.getCount()); for (auto it = v.begin(); it != v.end(); it++) { GiftCard *temp = new GiftCard(gcInfo); *it = *temp; delete temp; } If that's not a proper way to batch generate objects, please point my to the right direction. Full program here: https://pastebin.com/T2hB2usW P.S. I am aware that it's really poorly written, but I'm focused on making it work somehow first and refactor it later.
Anonymous
Hello, masters of bits. Im mad a bit, could someone help me with pointer arithmetic? char S2[100] = {}; char *start, *end; .... char *l = &S2[0] + start + sizeof("MEH") - 1; .... invalid operands to binary + (have ‘char *’ and ‘char *’) why i can't get that adress?
Anonymous
Anonymous
neovstan
what is lambda function?
auto func = []() { std::cout << “Mein gluck” << std::endl; }; func();
Alijon
#include<iostream> using namespace std; int main() { int n; cout<<" n :";cin>>n; double q,r,b,c,d; cout<<"q:";cin>>q; cout<<"r:";cin>>r; cout<<"b:";cin>>b; cout<<"c:";cin>>c; cout<<"d:";cin>>d; double xn=0; int x0=c,x1=d; int k=2; do { xn+=q*x1+r*x0+b; k++; x0=x1; x1=xn; } while(k<=n); cout<<"S:"<<xn<<endl; return main(); }
Alijon
Hello guys
Alijon
If n=4 q=1 r=1 b=1 c=1 d=1
Alijon
Final result is equal to 20 ,but it should be 17
Alijon
First xn=3 The second xn=5 The third xn=9 And the sum of this xns is equal to 17
Alijon
If you know it guys , pls help
David
ok
Brian
I need to learn C and C++ language
Brian
Someone help me and direct the specific book to study
klimi
I need to learn C and C++ language
Google and YouTube, cpprefernce for reference, you can find exercise problems on many coding sites, you can get example of programs on github
DaviChan
Someone help me and direct the specific book to study
There are sole really good ones in German. In english i found accelerated C++ good as a first introduction. Gets you statted quicky and you can learn details later.