19,876 Topics
![]() | |
#include<stdio.h> #define ROW 5 #define COL 5 int main(){ int array[ROW][COL]; int r=0, c=0; for (r=0; r<ROW; r++){ for (c=0; c<COL; c++) array[c][r] = (c+1)-(r+1); } for (r=0; r<ROW; r++){ for (c=0; c<COL; c++) printf("%5d", array[c][r]); printf("\n"); } printf("\n\n"); system("pause"); return 0; } i need help in this code I … | |
Hi, I seem to be having a problem with my code below, which I would like to be able to use to return 2 values from the result of a quadratic equation operation. The eReturn function takes care of negative square root values. I'm not getting any errors back, just … | |
i want to print myname mynam myna myn my m i have done in numbers but i can't print in string/char my code is i want to print myname mynam myna myn my m i have done in numbers but i can't print in string/char my code is main() { … | |
First off thanks for looking at this I have looked all over (both here and on the net) and tried several things trying to get this to work. I am using Visual Studio 2012 with DirectX (June 2010) SDK. I am attempting to write a fuctuin for sprite colission detection. … | |
Does the following code make p as a null pointer static int *p; since `printf("%u",p);` outputs as 0 though the syntax is `int *p=NULL or int *p=0` | |
Find the number of sequences in an integer array. A sequence is a list of numbers that comes in strict numerical order like [3, 4, 5, 6]. Sample Input : [1, 2, 3, 6, 8, 10, 11, 15, 16, 17] Sample Output : 3 sequences Any one can hlp please? … | |
**C++ Code:** #include <iostream> using namespace std; int sum(int n) { if (n <= 0) return 0; else return n + sum(n-1); } int main() { cout << "Range num? "; int num; cin >> num; cout << sum(num) << endl; return 0; } **My Pep/8 try at it:** br … | |
Hi all, Im trying to write a program that minimizes a Transition Graph (its basically combining states with similar numbers). Basically, the algorithm is to first find states with the same 'a' and 'b' inputs, combine them, remove them from the 'leftovers' list, then find states that have either 'a' … | |
How do I check if a certain IP address is online and get its current location in c# | |
I am making a text editor in c language.I need a help for moving characters left,right,up and down.I am using turbo c compiler and i want code for navigation and not an ascii key codes.... please help me with this as soon as possible.... | |
![]() | I am trying to read each word from a file and put it in a pointer then send it to a vector. Here is what I have so far. I am having a hard time sending the data to a function where I will add it to a vector. Here … |
pleas help me Write an algorithm to add and multiply two large integers, which cannot be represented by built-in types. | |
hello i was trying to do one of my assignments but i got stuck at sorting my strut arrays elements by alphabetical order. here is the code that i have dose so far but after this even reading as much as i can, i can not get to go any … | |
I am trying read CSV files in a C program on an AIX system. I am having problems getting fscanf to recognize the comma delimeter. I have read previous posts on this issue, and used the techniques dicussed in those threads, but I am still having the issue. Specifically, this … | |
I have two files which goes like this : FILE A is : J5 J15 J25 J30 J35 and FILE B is: J0 23 56 J5 24 58 J10 26 60 J15 29 63 J20 31 36 J25 23 32 J30 51 14 J35 34 21 J40 46 12 The … | |
Hello All, I have a small doubt w.r.t using mutex locks. Say we have a thread-safe function: int counter; void foo() { LOCK_MUTEX(); // say by pthread_mutex_lock ++counter; UNLOCK_MUTEX(); } Now, i understand that this is thread safe because only one thread can "own" a mutex at a time and … | |
![]() | Hi guys, This is not related to syntax or runtime problem. What I am going ask is more about how Linux and Windows handle writing data from buffer to a file. I have this code here, wrapped around a timing block, to write a buffer to a file. StartCounter(); if(rows … |
Having a small a problem with an array value here is the code:i want the array(totalwin) to store the value of the calulation each time it repeats say 10 times.I tried using the for loop but the values are not stored in the array what am i doing wrong. // … | |
> Hello Can Someone please help me with this problem. This is what i have sofar but i am not sure whats missing or how to end it please help. A solid steel column of circular cross section is needed to support a load of 65,000 lb. The ends of … | |
Well, I have just made this funtion that will split an array using a delimiter. I'm new to C++ so I will take any suggestions you have. Anyhow, good luck! Enjoy! | |
Hello there people. I am pretty new in C and programming in general. I was trying to make a password checking programme and I seem to be stuck. int main (void) {char ch; while ((ch=getchar()) != EOF){ This is the beginning of my code and whenever I try to type … | |
#include<stdio.h> int myatoi(const char *string); int main(int argc, char* argv[]) { printf("\n%d\n", myatoi("1998")); getch(); return(0); } int myatoi(const char* string) { int value = 0; if (string) { while (*string && (*string <= '9' && *string >= '0')) { value = (value * 10) + (*string - '0'); string++; } … | |
How can i link c# Asp.Net with ArcGIS software? | |
Given an array A of n integers, give an eficient algorithm to check whether there are two numbers in A whose sum is zero. [ ![]() | |
Alright so im supposed to represent an airline. total # of seats is 10. Passangers can choose whether to sit in first or economy. This is what i have so far. If you try the program and try to go from first to economy you will see that it skips … | |
[CODE]#include <conio.h> #include <graphics.h> #include <stdlib.h> #include <stdio.h> void main (int) { int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection. int midx,midy,x; //Initializing graphics and local variables. initgraph(&gdriver,&gmode,"d:\\bc3\\bgi"); //Reading result of initialization. errorcode=graphresult(); if(errorcode!=grOk) //An error occurred. { printf("Graphics error occurred : %s \n",grapherrormsg(errorcode)); printf("Press any key to stop : "); getch(); exit(1); //Terminate … | |
Write a code snippet to declare and accept an integer and calculate the cube value of the integer. The integer should be passed by reference to a function cube(). The function would calculate the result of cubing the integer. The function prototype to be used is: void cube (int *p); … | |
1) The & symbol in C returns the address of a variable. 2) In the expression, `printf(“%d”, (ans > val)? z : w);` displays the value of w if the condition is true. 3) In the expression, `for( ; a>b; )` A semicolon on its own indicates a null statement. … | |
Write a code snippet to declare and accept an integer and calculate the cube value of the integer. The integer should be passed by reference to a function cube(). The function would calculate the result of cubing the integer. The function prototype to be used is: void cube (int *p); … | |
I'm able to import the file and read it, but I don't think it's saving to the structure. I want to figure out how to save it within the structure so I can search/ delete the contacts. The unfortunately lengthy code is below: #include <stdio.h> #include <string.h> #include <stdlib.h> #include … | |
I can't figure out why a gives a value of 0, Can anyone explain? Thanks in advance. The output for this program is 770 include<stdio.h> include<stdlib.h> int a,b; void mystery(){ while(b>0){ int a; a=a+10; b=b-1; } } int main(){ a=7; b=a; printf("%d\n",a); mystery(); printf("%d\n",a); printf("%d\n",b); system("pause") return 0; } | |
please help me choose an title to do a package using **binary tree** or **multiply linked** list data structure.... | |
Hello I'm new to C++ and am trying my best to learn the language. Could someone please let me know why my program is not working. I have a feeling that I'm not passing values to and from functions. The program compiles and runs, but it just gives me a … | |
I'm using winapi function GetTickCount() with delta time and I'm calculating the displacement of an object on screen like this: number_Of_Pixels_To_Move_On_Screen = (speed*delta_Time)/number_Of_Pixels_Per_Milllisecond but I get uneven movement.Sometimes it moves a litle faster ,sometimes slower . Can someone tell me how to get the object to move at a constant … | |
Write a C# program that searches a file for a string. Pass the string and the file name as program arguments. | |
Alright to add the ability to import files into a phonebook app that I created, but my issue im having is when I just add a counter to loop through the function that pulls the data from the file, it prints out names many different times, in different orders. I … | |
I am very new to programming language and need help urgently. I am running a program which gives me one output file for every 5 min simulation. i have to copy and rename the output file in each step so that they can be used in another program . Any … | |
Hi everyone, Currently for a university project I am building a server that can send notifications to a mobile device. Part of the project involves building a front end where I can configure everything for the server - updates to send, rules and so on. On the front end I … | |
Hello! How is everyone? I know this program is somewhat simple, but I am working on learning classes, and I am trying to implement this in my code. I pretty sure my mathematics done in the program are correct, or at least on the write track. Here's what I am … | |
Hi everyone I'm using stat() function to get the file's attributes , but I don't know how to get the permission of it . So can anyone tell me how to find the permission of the file?? Thanks in advance | |
#include <stdio.h> #include <stdlib.h> int main(void) { double a = 0.0; double b = 0.0; scanf("%lf", &a); printf("\nThe first number is %f", a); getchar(); return EXIT_SUCCESS; } The question is : how can the program continually re-prompt I mean when i enter the number, and then the number i entered … | |
Does anyone know how to write a program that minimizes a finite automata? | |
![]() | Credit card numbers follow certain patterns. A credit card number must have between 13 and 19 digits. It must start with for example: 4 for Visa cards 5 for Master cards 37 for American Express cards 6 for Discover cards So, this here is the code thats identify either a … |
Rewrote this a few times heres the meat and potatoes. Has a few issues such as flashing when moving in different directions quickly. Thinking of trying to clamp a few values to try to stop the diagonal movement,flashing and smoothing out the sprite. Something along these lines might update this … | |
Hi I need some good study material related to it. How can i eject my DVD ROM drive using C coding. similarly, how can i change fan speed, how can i shut down my PC using C coding. I need urgently. | |
What is the best way to practice C++ coding on Windows 7, and at the very least free? I want to get better at programming, but I don't have a compiler. | |
Alright. I am making some decent progress here. I am trying to add a toolbar to my basic text editor that I am making using an internet tutorial. Anyways the problem is that I can get the bitmaps to display but they appear to be just that... bitmaps. When I … | |
I apologize for the inconvenience this not a Qt question. I am using a library in my Qt application which is built and generated by lex and yacc compiler. When I am calling first time the function it’s working fine, a good file. Next time running a bad file from … | |
Guys I installed "windows Vituual PC" with xp vesion in windows 7 ultimate 64 bit. Now I am not able to install c++ software in it so please tell me how to install turbo c++ in VMplayer plzzzzzzzz full detail . |
The End.