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
Mohammad
𝖳𝗁𝖾 𝖠𝗅𝗀𝗈𝗋𝗂𝗍𝗁𝗆 𝖭𝗂𝗇𝗃𝖺 ⚪♛
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
Dima
lol what kind of interviewer would watch your followers
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"
klimi
Islom M1Ö
Hello everybody
I have a project
I did it but have some problems
Who can help me please
Denys
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
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 ?
Ayushi Gupta!!😼
/* 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 ?
Is it a hackerrank ques?
Jose
/* 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 ?
totally understandable, the last sentence even more!
PIZZA
/* 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 ?
why not using else if?
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?
PIZZA
PIZZA
Pknatic
PIZZA
Pknatic
PIZZA
else if*
Pknatic
Ayushi Gupta!!😼
DMing you guys ..cuz media sharing isn't allowed here
Pknatic
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
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
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?
Sajjad
Anonymous
Anonymous
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
Eugene
Anonymous