|
I am trying to convert the GMT time into unix epoch (starting from 1970), looks like there is a small bug in code , i could not get and exhausted. I see following difference Non leap years Expected output: Jan 20 19:00:01 2019 GMT = 1548010801 Actual output: 1548097201 (which is Jan 21 19:00:01 2019 GMT, 1 day difference) Leap Year Expected output: Dec 27 14:52:30 2020 GMT = 1609080750 Actual output: 1609253550 (which is Dec 29 14:52:30 2020 GMT, 2 days difference) I really appreciate any help in finding the problem. ` #include <stdio.h> #include <string.h> #include <time.h> #define … |
0
101
|
||
|
So, basically this code is for a Tic Tac Toe game, I'm trying to make a Singleplayer mode where Player 1 inserts a spot number to put his X, and Player 2 uses a random number generating function and assigns his O in a random spot. Everything works fine except, Player 2's random number does not get assigned on the board. #include <stdio.h> #include <stdlib.h> #include <conio.h> #include <time.h> char choice, choice2, modsel; int player = 1, winner, end = 0, counter = 0, ran_num; char arr[3][3] = { {'1','2','3'},{'4','5','6'},{'7','8','9'} }; void numgen(int rannum) { srand(time(NULL)); rannum = 1 + … |
0
38
|
||
|
does anyone please have the connect four game program in c language? I need it for an exam |
0
19
|
||
|
So, basically what I'm trying to do is a Tic Tac Toe game for a project. I started with making 3 1-D Char Arrays to represent the game's bord. the code below compares the Arrays data to try and figure out if any of the winning possibilites were achieved by option x or y. There is a variable set to 0, this variable will change to 1 if player1 won and will change to 2 if player2 won, if it remains 0 then it's a draw. Now, there's 16 errors of Error C2446 '==': no conversion from 'const char [2]' … |
0
128
|
||
|
How can I write the code such that - 1. I am reading the file which may contain numbers such as 23 34 45 56. 2. After reading the contents of the file, the contents of the file get stored to struct array such as struct abc in the above code... 3. struct abc later gets called under the int main(). |
0
31
|
||
|
i need help developing a small minesweeper game |
0
8
|
||
|
Hello, i have some problems with my c code, could you help me? it's returns randomly numbers for averages. #include<stdio.h> #include<stdlib.h> struct Student MStudent(struct Student std); void CalcAvrg(struct Student std); struct Student{ int mark[5][5]; }; struct Student MStudent(struct Student std){ int i,j; for(i=0;i<5;i++){ for(j=0;j<5;j++){ printf("%d. Student's mark for %d. exam :\n", i+1,j+1); scanf("%d", &std.mark[i][j]); } } return std; } void CalcAvrg(struct Student std){ int i; for(i=0;i<5;i++){ printf("%d. Exam's average is: %d\n", i+1, (std.mark[0][i] +std.mark[1][i] + std.mark[2][i]+ std.mark[3][i]+ std.mark[4][i])/5); } } int main(){ struct Student dene; MStudent(dene); CalcAvrg(dene); return 0; } i wrote it in this way too, but it didnt … |
0
103
|
||
|
int my number [10]; void fun(int input, int* addr){ if (input %2 == 0){ *addr = 1; } } int main (){ int i; for (i = 0; i < 10; i+=1){ fun(number[i], &number[i]); } return 0; } |
0
26
|
||
|
I want mini project of data structure using c language can anyone give source code?? |
0
29
|
||
|
התוכנה כותבת לי שגיאה על המילה strndup אולי מישהו יודע אם זה משתנה בגרסאות של וויזואל סטודיו ואיך אפשר לסדר זאת? char tav = str[strlen(str)/2+1]; int a,b,anser; char* as = strndup(str, strlen(str) / 2 - *str); char* bs = strndup(str+ strlen(str) / 2 - *str+2, strlen(str) / 2 - *str); a = atoi(as); b = atoi(bs); if (tav == '+') anser = a + b; else if (tav == '-') anser == a - b; else if (tav == '*') anser == a * b; else if (tav == '/') anser == a / b; puts(str); |
0
48
|
||
|
How will you guide student?? |
0
60
|
||
|
#include <iostream> using namespace std; int main () int charge, aftercharge, parking_hours; cout << "please put your parking hours: " ; cin >> parking_hours; if (parking_hours>=1) { charge = 1 ; } else if (parking_hours>=11) { charge = 2.50 ; } else if (parking_hours>=12) { charge = 6.00 ; } aftercharge = parking_hours*charge ; cout << "your bills RM" << aftercharge; cout << "this is your charge RM: " << parking_hours; return 0; |
0
93
|
||
|
#include<stdio.h> #define SIZE 10 struct stack{ int a[SIZE]; int top; }; struct stack s; s .top=-1; void push(int value); void pop(); void display(); void peakelement(); int main() { int choice,value; while(1) { printf("\n1.push 2. pop 3.display 4. peakelement 5. exit"); printf("enter your choice"); scanf("%d",&choice); if(choice==1) { printf("enter value to be pushed"); scanf("%d",&value); push(value); } else if(choice==2) { pop(); } else if(choice==3) { display(); } else if(choice==4) { peakelement(); } else if(choice==5) { break; } } return 0; } void push(int value) { if(s.top==size-1) printf("stack overflow"); else { s.top=s.top+1; s.a[s.top]=value; } } void pop() { if(s.top==-1) printf("stack underflow"); else { printf("%d … |
0
60
|
||
|
JQ is taking a car trip with his family. On the trip, he will stop for fuel, food or lodging. When stopping for gas, JQ will record the amount of fuel he is willing to pay for. When the family stops for lodging, they will also have a meal. JQ is only willing to spend a maximum of $75 on accommodation. If the motel manager says the price is greater than $75, JQ will complain “We will look elsewhere”. If the charge is less or equal to $75, he will pay the amount and exclaim “Wonderful, we will stay!” JQ … |
0
62
|
||
|
I would like to know what is the difference betn getchar(),getch(), and getche() functions and which should be used in which conditions. Thanks, comwizz. :confused: |
1
4,308
|
||
|
Hello, I have been trying to get this robot to work out and be able to move around. I am just so confused as to how to get my arrow to get even displayed and moved when pressed by one of the directions to go. One area that I struggle with is the classes and event handlers as has probably been my biggest issue facing this assignment. Anyways this is what I have so far and thanks in advance for any help. Robot.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.Threading.Tasks; namespace Robot { public enum … |
0
44
|
||
|
write down a program which generates numbers from 1 to 10 but in following format in C++ 1 2 3 4 5 6 7 8 9 10 |
0
47
|
||
|
This is my Code C++ for my assignment. Please help me to convert it to C code. Thank you! #include<iostream> using namespace std; #define N 10 int main() { int array[N],p,q; for(int i=0;i<N;i++) array[i]=i; cout<<"For instance, given elements are "; for(int i=0;i<N;i++) cout<<array[i]; cout<<endl; int r=0; while(cin>>p) { cin>>q; if(p>=0 && p<N) { for(int i=0;i<N;i++) if(array[i]==p) array[i]=q; cout<<p<<" "<<q<<" "<<r++<<" "; for(int i=0;i<N;i++) cout<<array[i]; cout<<"\n"; } } } |
0
95
|
||
|
Hi All, I would personally looking for someone from the US for a partnership. This will be something like a part-time job that needs 5 hrs per week. Requirements: US citizenship for legal issues. Basic understanding of technical - Junior Full-stack (web and mobile development) Experience working remotely. Open-minded and think out of the box. Always kind & cooperative. Compensation: Estimate $1k+ per month as a base salary and get a bonus if this works out well. DM me for more details if you have an interest. Thank you for your attention. Are you interested to get $1k per month? … |
0
49
|
||
|
I’m trying to create a program that accepts a string of characters, which should be able to perform push, pop and peek. The code is running, but the program only accepts the first letter of the string. I’ve tried many different ways to implement the code, but I’m still not getting the program to work as expected. I have a fair understanding how to use stack to accept numbers, but I’m unable to perform the task on a string of characters. Each node should store one character from the word. Note: some functions were snippets of code from online source … |
0
40
|
||
|
Can you help me decrypt the message with the given information. I figured out the first line is using Xor ciphers but how do I figure out the rest? Y[ZU[XZWZ\XXZjZ[[WWVWU Ogaqkxpgbqbfiof! Cyw'ss bun! Zqksxl cywd lnepwvs uozneh. Qjc mgabiy nfx vmz-djrhkfalfq. Xnjfx ai qjvi viqi uat pgw odjwp. The radio operators have some information that they share with you, in their attempt to decrypt the message. The information is as follows: ‐ The first character of the entire message decrypts to the number ‘5’. ‐ It is known that the first line of the message forms some sort of combined … |
1
116
|
||
|
.. |
1
16
|
||
|
Hello guys, It my frist topic in this forum so i hopeI hope you like it🙂🙂 In this topic we w'll learn how to check internet connection using a simple code. frist make a new project And add a label and timer . second Double click on timer to type code . bool con = Networkinterface.GetIsNetworkAvailable(); if (con == true( { lable1.text="your are connect"; } else { label1.text="you are not connected"; } You can watch the explanation from here[Click Here](https://youtu.be/hL5vrTB1uTQ) |
1
111
|
||
|
https://payloadz.myshopify.com is my new site, im a computer science student i started it to showcase the vulnerabilities in linux |
0
24
|
||
|
This program is not displaying the "Student Statistics" and Name in the output. Please solve this issue. Thanks Program Link: https://www.daniweb.com/programming/software-development/threads/469457/project-title-student-record-registration-using-linked-list |
0
58
|
||
|
Hi friends. Please tell me how to display a image file on the screen in C? If u r kind to me, send the code snippet. |
0
7,481
|
||
|
Mr.X owns a small business in a region with poor law-and-order. Recently his warehouse has been plagued by thieves. Gangs of thieves raid over his warehouse from time to time, stealing his raw material, affecting his business. He has studied the occurrences and noticed it that they are cyclical. Assuming that a work week starts every Monday, and Sat and Sun are holidays, predict the total number of days when business would be affected. Ex: He has noticed that currently there seem to be 2 gangs. Gang 1 raids every 4 days, whereas Gang 2 strikes every 6 days.( See … |
0
51
|
||
|
basically my sister had a ipad ,and she was using for a long time and was enjoying using it and she forgot her ipad password. there was no way to reset the password without going to shop and we couldn't be bothered to take to pc store to reset the password and she asked me to guess the password as she know i would be able to as she she knows i managed to guess other people's password to the computers or something like that and break in succesfully as i told her that, and i wasn't lying to her … |
0
137
|
||
|
Hello friends. I am new at programming and need to programm "X" as an assignment [](https://freeessaywriter.org/) (pic is attached) The "X" should be arbitrarily large or small and the edge length of the "X's" should be entered by the user. The code is below. Would highly appreciate any help: include <stdio.h> int main () { int edge length, i; printf ("Please enter the edge length of the pattern: \ n"); scanf ("% d", & edge length); char sign; character = ''; for (i = 0; i <edge length; i ++) { printf ("-% c- \ n", character); } return 0; … |
0
48
|
||
|
i'm learning Math for 3D... for now i can draw a plane and convert 3D to 2D(the screen is 2D): Private Function ConvertPositon3DTo2D(Position As Position3D, World3DSize As Size3D) As POINTAPI Dim ConvertedPosition As POINTAPI Dim PosZZDepth As Long PosZZDepth = Position.Z + World3DSize.Distance If (PosZZDepth = 0) Then PosZZDepth = 1 'avoiding division by zero Dim Width As Double Dim Height As Double Width = World3DSize.Width / 2 If (Width = 0) Then Width = 0 Height = World3DSize.Height / 2 If (Height = 0) Then Height = 0 ConvertedPosition.X = (Position.X * World3DSize.Distance / PosZZDepth) + Width ConvertedPosition.Y = … |
0
75
|
The End.