- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 39
- Posts with Upvotes
- 29
- Upvoting Members
- 19
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
a technology enthusiast and a passionate coder
[B]hi friends[/B] this small compact code is for printing any number of prime numbers in C Language, you just have to change the last line's 500 to any number you want, here some points necessary to understand the code are as follows- 1.> variable torf stands for true or false,in … |
|
Hi Everyone I want to make my code run from command prompt I am using window 7 and JDK 6 Following are steps I did: 1) Created a Text file Example.txt. Changed the file extension to Example.java and placed it under C:\myWork 2) Open command prompt type 'dir' to see … |
|
hi :) is there a possible way where in we can combine two rows for an example i have this code: #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream outfile; outfile.open("1stRow.txt"); for(int i=1;i<10;i++) outfile<<i<<endl; outfile.close(); ofstream outfile2; outfile2.open("2ndRow.txt"); for(int j=2;j<11;j++) outfile2<<j<<endl; outfile2.close(); //return 0; } … |
|
How to call a C++ function which is compiled with C++ compiler in C code? |
|
I am trying to get at least 5 minimum values from an array of integer my code attached works but it skips few values public static void main(String[] args) { int array[] = {0, 1, 2, 1, 4, 5, 1, 7, 8, 1, 10, 11, 12, 13, 1, 15, 16, … |
|
What would be the best way (or any way) to print out a pattern, that may cut off at any point dependant on the x & y length? for example, if i wanted a pattern 4 up (y = 4) and 14 across (x = 14) I would need it … |
|
# copy string into a structure # all i am trying to do here is to copy a string input given by user into an arry decleared inside a structure.but my code is not working. anyone please explain to me why this code isnt working #include<stdio.h> #include<string.h> typedef struct{ int … |
|
error in ma program it shows the last digit twice. #include<conio.h> #include<stdio.h> int main() { int fib(int); int n,c,a=0,b=1; printf("enter a number: "); scanf("%d",&n); printf("%d %d ",a,b); c=fib(n); printf("%d ",c); getch(); } int fib(int n) { int a=0,i,b=1,sum; for(i=0;i<n-2;i++) { sum=a+b; a=b; b=sum; printf("%d ",sum); } return(sum); } |
|
# copy string into a structure # **all i am trying to do here is to copy a string input given by user into an arry decleared inside a structure.but my code is not working. anyone please explain to me why this code isnt working** #include<stdio.h> #include<string.h> typedef struct{ int … |
|
Hello to all, I missed a class for the array section at uni and have been sick couldnt really jump back into it. Could you guys help me solving this? :) Write a Java application that does the following: 1. Reads an integer from the user represents the number of … |
|
what is the difference between std::cout<<"dfdfd"<<endl;//everywhere and using namespace std::cin putting above line at the top of the main function and putting the below line at the top of the main using namespace std; and + 2 bonus questions. 1.Are there any other namespaces than 'std' in c++? 2. Are … |
|
the answer of Write a class for rational numbers. A rational number is quotient of two integers, such as 2/3 or 1/2. Your class should have three constructors. One constructor takes no argument, and initializes the rotational number to 0. Another constructor takes a numerator only (the denominator is assumed … |
|
Hi all, hope you can give me some help to edit my code. I'm unaware how to merge two arrays and allocate them to a third array(of the right size) and let's just say for the sake of things, we'll call it C. I went ahead and instead used the … |
|
I'm working on learning some basic java programming. I have a project that I've been working on dealing mostly with arrays. I have completed the objective, I'm just not sure that I did it in the most effective way possible. My question here is to see if an experienced java … |
|
Hello, I am trying to understand what a byte array is. public class ByteArrayExample { public static void main (String args[]) { byte[] array = "1".getBytes(); System.out.println (array); } } The output of this program is : [B@44770739 Is this a hexadecimal representation? If any of the members can explain … |
|
hey this sounds like a really simple question to me but I can't seem to figure out how to do it! My code so far is public class numbers { public static void main(String[] args) { final int N = (args.length); for (int i = 0; i < N; i++) … |
|
hey guys so i am having a problem in my assinghmnet . i am making a text file and it has to import to java and make a table from the text file . so there is what the txt file looks. 3 // this should be the rows 1,2,3, … |
|
`Inline Code Example Here`**I REVISED MY PROGRAM** #include <iostream> #include <cmath> using namespace std; int main () { const int num=100; float volt[num], sum=0, sum2=0 ; double ave2,standrddev1, standrddev2, standrddev; float average; int i, k=0 ; { cout<<"Enter the number of voltages to be analyzed:"; cin>>k; if (k>100) { cout<<"Maximum … |
|
So this more than likely has a simple answer, but i cant seem to find it. I have a 2d array in one class, what I want to do is get this array into my other three classes. Now I'm not sure but I believe I have to use inheritance, … |
|
# we are assigned to develop a c++ program that accepts a list of a maximum of 100 voltages as input, determine both the average and standard deviation of the input voltages, and then displays the results. There are still errors and it says it requires array or pointer type. … |
|
# Develop a c++ program that accepts a list of a maximum of 100 voltages as input, determines both the average and standard deviation of the input voltages and then displays the results. # ## step 1 : requirements : an average, standard deviation step 2: develop solution: the input … |
|
Hi, I am currently making an assignment for JAVA, but I get stuck at the following. I need to make a simulation of a shop where a customer puts objects in his "basket" and with that basket you go to the checkout counter. Now we have to make it possible … |
|
|
Hi everyone I hope you guys could give me a hand with this project, I am not an expert of c++ and i am really struggling with this. here is the problem: I been asked to make a programn as follows: A new railway journey planner is required to help … |
I am trying to sort a certain amount of integers. I have an error in my code. The code is below as well as my error message. Any suggestions of how to fix this? I believe it has to do with it being primitive data rather than an object? `public … |
|
Hello I have this problem where my text file is not read in properly to the linked list. It spits out only zeroes. Here is the code I have written. Thanks. include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; struct widget { double R; double S; int … |
|
I have been asked to write a coding for calculate GPA by using struct and array. I want to display the ouput for every subjects's name, subjects' code, grade for every subject and GPA for every sem but i coulds't get the ouput i want. I think i had done … |
|
public static int f (int []a, int []b,int []c) { final int N=a.length; int j, k=0, g=0, t=0 ; for(int i=0;i<N;i++) { for (j=0;j<N;j++) if (b[j]==a[i]) break; if (j==N) { c[t]=a[i]; if (g==0 || c[t]>k) { k=c[t]; g=1; } t++; } } return k; |
|
Hey... I have created a prgoram in turbo c++, and i wanted it to export it as a separate file ... that is out of the bin file.. and out of all the other include file, so that it actually runs on every computer who even does not have a … |
|
Dear all, I have following code and i want to write elements of array in single string(merge with ,) , in between all the values. like a[0] = "hi" a[1] = "hello" a[2] = 1 a[0] = "get" a[1] = "post" a[2] = 2 a[3] = 45 then i want … |
|
Im trying to write a program that simply takes a string input and reverses it. I want the program to repeat itself by asking the user then starting over. The problem im having is that when the program first runs, the getline function works correctly but then after the program … |