49,757 Topics

Member Avatar for
Member Avatar for abeer06

#include<iostream> using namespace std; int main () { char a; double length; double width; double Area; cout<<"Please\n"; cout<<"\t1- Enter \"S\" or \"s\" to calculate the square area\n"; cout<<"\t2- Enter \"R\" or \"r\" to calculate the rectangle area.\n"; cout<<"\t3- Enter any Key to Exit\n"; cout<<"Please enter the length of square"; cin>>length; …

Member Avatar for abeer06
-1
116
Member Avatar for murnesty

Hi, I'm looking for embedded system or os source code example. Just to learn some common error or good way to write some device process. Probably in C or C++. Is there any good suggestion?

Member Avatar for David W
0
229
Member Avatar for hafza.sana

take an input date of birth from the user and display star of entered date of birth Plz help me in ths programm

Member Avatar for David W
0
147
Member Avatar for learner_new

#include<iostream> using namespace std; int main() { int len1; cout<<"please enter the length of arrayn 1"; cin>>len1; cout<<"creating array now"; int *arr1= new int[len1]; cout<<"please enter the elements now"; for(int i=0;i<len1;i++) { cin>>arr1[i]; cout<<endl; } return 0; cout<<arr1; delete [] arr1; } In the above code, the program stops execution …

Member Avatar for shaykhhamza
0
295
Member Avatar for glao

I am trying to use column major order to a 2d matrix which I am using as 1d. int N=3,R=2; for (int i=0;i<N;i++){ for (int j=0;j<R;j++){ //printf("\nX[%d]=%d\t",i+j*N,res[i+j*N]); //column major // printf("\nX[%d]=%d\t",i*R+j,res[i*R+j]); //row major } printf("\n"); } but the column major doesn not work as it should. Also,if I want to …

Member Avatar for glao
0
328
Member Avatar for mixelplik

OK, I've acheived HULK SMASH levels of frsutration with this one. I simply want to parse a date in the form of ##/##/#### The code below works peicemeal, ie each part SEEMS to work, but if I cout at the bottom the day is dissapearing or spitting out erroneous crap. …

Member Avatar for David W
0
208
Member Avatar for Labdabeta

Hello, I have a file which I need to read which contains some unusual characters (EG: '╠') and I need to be able to read it and convert those characters to numbers. As an example of what I am looking for would be code that reads a file and prints …

Member Avatar for Labdabeta
0
411
Member Avatar for ashley.vanhoesen.7

I am trying to create a palindrome checker using a single stack and pass by reference method. I just have to write the evalPalindrome() method and then I input it into a web application which holds the main. For some reason, however, when the main is calling the pass by …

Member Avatar for David W
0
686
Member Avatar for cnsk90

#include<stdio.h> #include<math.h> int main() { int n,nstart,nstop,nstep,i,j,zNumber; ` printf("Please enter a value of a positive integer nstart: "); scanf("%d",&nstart); printf("Please enter a value of a positive integer nstop: "); scanf("%d",&nstop); printf("Please enter a value of a positive integer nstep: "); scanf("%d",&nstep); printf("Number\t\tzNumber\n"); printf("------\t\t-------\n"); n=nstart; zNumber= double pow(double_n,double_i); while(i<=nstop){ zNumber = …

Member Avatar for David W
0
771
Member Avatar for Yogesh_9

#include<iostream> using namespace std; int main() { int test; cin>>test; while(test--) { int start,end,m; cin>>start; cin>>end; bool arr[end]; for(int i=0;i<end;i++) arr[i]=true; for(int i=2;(i*i)<=end;i++) { for(int p=2;(p*i)<=end;p++) { m=(p*i-1); arr[m]=false; } } for(int i=start-1;i<=end;i++) { if(arr[i]!=0&&i!=0) cout<<i+1<<endl; } } return 0; }

Member Avatar for StuXYZ
1
372
Member Avatar for tolatallest

i need parallel program that can sort 500,1000,1500,2000 numbes in bubble sort,selection sort,insertion sort and merge sort.

Member Avatar for mike_2000_17
0
113
Member Avatar for OceanDesigns

Hi guys im a beginner at programming i started a book for beginners im only on lopps now but as uasuall i googled and wondered off into classes i keep getting this error, i initialized the float variables in the class by using the constructor. I'm not sure if this …

Member Avatar for OceanDesigns
0
115
Member Avatar for glao

If I want to multiple 2d arrays as 1d how should I do it? I mean ,I have a 2d array and I map it as 1d: for(int i=0;i<rows*cols;i++) A[i]=... I know how to multiply 2 arrays as 2d ,but representing them as 1d?

Member Avatar for glao
0
2K
Member Avatar for Mohamed_31

A space shuttle measured the distance between earth and Mars as a very large integer number of centimeters. Write a C++ program that reads such distance as centimeters and displays the kilometers, meters and centimeters equivalent.

Member Avatar for Elixir42
0
146
Member Avatar for tharindu123
Member Avatar for leonardo.hieu

Hey guy. I'm a new beginner in C++. I'm have some problem with my new code I have just written. I try to draw a triangles with from the characters "*". But it isn't work like I want. Here is it. `#include <iostream> using namespace /* Draw a triangles */ …

Member Avatar for David W
0
143
Member Avatar for Gupta_1

hi friend i would like to make a programe in c++(code block) . which include the fallling candy, and the candy is collected by a baby below. so could you help me to make that game in c++

Member Avatar for Ancient Dragon
0
130
Member Avatar for prajwaludupa

well i tried to execute the following code.. #include<process.h> #include<conio.h> #include<dos.h> #include<stdlib.h> #include<stdio.h> void main() { system("dir"); getch(); } but it did not execute the system command... what went wrong?? plz mail me at [email]prajwaludupardx_369@yahoo.co.in[/email]

Member Avatar for sri.voma
0
657
Member Avatar for ansar.ahmed.7967

how and what statement is compiled by compiler. want to check step by step so that i can understand the logic of a program for example in nested for loop when and how many time inner loop will execute and when outer loop execute. hope understand my question

Member Avatar for NathanOliver
0
115
Member Avatar for Christoffer_S

Hi, First of all, I'm a newbeginner in C++. Ok, basically I'm tring to make a calculator with functions. Every function calculates either addition, subtraction, division or multiplication, pretty simple. Though I can't get it to call these functions! Here, take a look at my code: #include <iostream> using namespace …

Member Avatar for Schol-R-LEA
0
643
Member Avatar for محمد_44

How i can make a Matrix by using 2 dimension arrays and function ? please i need answer thanks.

Member Avatar for David W
0
130
Member Avatar for blazemadej

My program is almost done, but when i try to convert a number into cents, it does not calculate the cents properly. So if i enter 325, it says i have 3 dollars and 325 cents and my running total is not working. Each time NormalizeMoney is called it should …

Member Avatar for David W
0
4K
Member Avatar for Dương_2

I newbie on C++, I hope everyone help me learning by ebook tutorial simple C++. Thank so much !

Member Avatar for vmanes
0
99
Member Avatar for boris90

Hi! I've had this problem for a couple of days now, and I don't know what it is. My Visual Studio 2012 project worked perfectly before, but now it just hangs at the "Generating code..." part. It *litteraly* takes forever. I once left it for more than 30 minutes, and …

Member Avatar for dreslough
0
2K
Member Avatar for john.kane.100483

Hi really need help. I'm new to programming and my teacher just gave a problem program "Conversion from any base to base 10" . So search in google and find this source code. I just combined the source code. This will run if it not combines. But I want this …

Member Avatar for David W
0
247
Member Avatar for mpid

what is the output that accepts integer value to num and i and calls a function that changes to zero the ith digit of a num if it is an odd value,if there is ith digit the value will remain the same.USE POINTER TO AN ARRAY.

Member Avatar for vmanes
0
66
Member Avatar for Elixir42

Hi Kind-DaniWebbers, How do you initialise a boost::archive:binary_oarchive in a different place to where you declare it? So: class CBase { std::ofstream m_ofs; boost::archive:binary_oarchive m_binOA(); // <== default constructor virtual void Open(std::string& s) = delete; }; class CDerived : CBase { void Open(std::string& s) override { CBase::m_ofs("filename.bin", std::ios::binary); CBase::m_binOA(CBase::m_ofs, /*flags*/); …

Member Avatar for Elixir42
0
417
Member Avatar for vegaseat

Here is an example on how to put at least lines and circles onto your windows console display. Yes, you have to jump through a hoop to do it. Dev-C++ can do this thanks to some BCX generated code. You have to set up your project as a Console Application …

Member Avatar for petersvp
0
10K
Member Avatar for Dostoyevsky

Hi All, I've just joined your community hoping to get help with Visual C++ and Visual Studio 2008. I'm not much of a developer and different people were putting this together for me so the code is a bit messy as well. Right now I have everything in place but …

Member Avatar for Dostoyevsky
0
252
Member Avatar for jainasamiento

• my assignment is to find the commission of each monthly sales,how can i get the right answer? monthly sales is 0-19,999(4%)/ 20,000-29,999(5%) /30,000-39,999(6%) / 40,000-49,999(7%) 50,000-above(9%) using if/else statement then,,how can I make a flow chart related on this problem.? can you plese lead me to the right answer?

Member Avatar for David W
0
262

The End.