49,761 Topics
| |
#include<iostream> using namespace std; int main() { int a,d; cout<<"Enter a integer to check it is prime or not :"; cin>>a; d=2; while(a%d!=0) { d++; } if(a==d) { cout<<"\n the given number id prime "; } else cout<<"\n the given number is not a prime number ;" return 0; } | |
hi, guys i'm in colleage trying to do some homework with cs10 and got stuck with this combination of functions please help me out!!!! T^T spent 8hours today still couldn't figure it out #include<iostream> using namespace std; void getProbsPerSet(); void doOneset(char Func); void doOneproblem(int &Answer); void getMaxnumber(int &MAX); void printHeader(int … | |
Okay, I am trying to learn Windows programming and there are all sorts of new data types that I am running into and need to learn. I'm trying to understand the point of it all and failing. If there is no point and it's just Microsoft making things difficult for … | |
The example in this post is from** C++ Primer Plus (6th Edition)** by *Stephen Prata* **My question:** Why cin.ignore( ) is not used in his example? Shouldn't we discard the buffer with a line similliar to this: `std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');` Example from the book: int fill_array(double ar[], int limit) { using … | |
OK, I programmed a few DLLs using Linux years back. My memory (and my memory could be faulty), was that I had the program decide which dll to load based on user input. So I had two dlls, each with a `string encrypt(string, string)`function. The user was asked to specify … | |
(create a c program which reads a sequence of daily temperatures for one month, stores them into an array temp and finds the average temperature with a function average.) ı dont know Dev c++ . how i made this? please help me. | |
Hello I'm interested in CPA Certification and need Free and paid web based tutorials,Study Guides .Please reply with accurate instructions and materials. | |
Hi, I have one function (in a library I can't change the code) which takes a key and returns a Object. This code is written in java. I am calling this function from cpp code. I am accepting the result as jobject. 1. Added key as "key1" & value as … | |
I'm a developer lead and I'm trying to get actual statistics on how many developers are comfortable in multiple C-like languages. I'm specifically interested in the crossover amongst C, C#, C++, and Objective-C. This is a legitimate quesiton, not a spam. Instead of asking everyone to post a comment...I've created … | |
2) Write a program that computes the average of all even numbers in the range 3 to 111, inclusive. Use a counting loop. Display the average in a suitable format | |
Write a program in C++ to prepare a frequency distribution table of the percentage marks in Computer studies of sixty students, to be taken as inputs, into the following categories Category Marks(%) Fail 0-34 Pass 35-59 Good 60-79 Very Good 80 and above | |
#include<iostream> #include<iomanip> #include<string> #include<cctype> #include<stdlib.h> using namespace std; struct Product { string PLU_Code; string Fruit_name; int SalesType; double UnitPrice; double InventoryLevel; }; const int SIZE = 100; int populateInventory(Product *[], int); bool validatePLU(const string &); int main() { /* (Normal way of allocating ) Product *NumArray; NumArray = new Product[SIZE]; … | |
Hi, I am trying to make small game , but I am confronting with a problem. I have a function that should add a new button to my form when it's called. The problem is that I don't know how to create a new object (a button, a shape or … | |
| Hi, everyone. I want to create a RISK-style game in C++ with decent graphics, of course. I would like to create a map with countries as buttons [I know that this is possible in java through extensions but I want to do this in c++] Could anyone please help me … |
We wish to write a program countletter.cpp that takes a filename and a single character on the command line and prints the number of occurrences of that character in the file | |
can someone please explain me this piece of code //say getdetail() is a function declared above a.getdetail(); f.write((char *) & a,sizeof(a)); | |
In this code if we enter the prime numbers like 3,5 or 7 the output is wrong.and if we input 3,11or 17.. output is correct why???? | |
Hi i'm make an Inventory System for my personal game project with C++ Composite pattern. What I'm going to do is set a limit so player unable add item once hit the specific limit. but here my problem : 1. Did i set the limit & add item function correctly? … | |
Hi All, I would like to know how to implement reflection is c++ as this feature it is not supported by c++. (1)Base *base_ptr= new derived1(); (2)Base *base_ptr= new derived2(); (3)Base *base_ptr= new derived3(); can those derived object ype can be assigned through vector or string? I.e string list []={"derived1","derived2","derived3"}; … | |
I am working with a code which stores the information of customers in a file called customer_details.txt then asks the user to enter a name and then searches for the name in customer_details.txt, if the name is found, the entire details of the user is displayed on the output screen. … | |
Can anyone provide me C++ implementation of Adaptive Huffman Coding ? | |
hi,i'm beginner for programming and i don't know how to use pointer in a c++ programming. | |
| Hi everyone. I am makng a RISK game and I am working on a territory class here, and I got a strange message that my google searches have not shed any light on. My code is below. First, my header file: // Class represents each individual territory on the map … |
| Hi everyone. I am trying to develop a class for a RISK boardgame, and I used UNIT_COLOR and UNIT_TYPE enums to represent the different types of pieces. These enumerations are defined as public in my class but are causing complete havoc in my code because with the C++11 "class enum," … |
hello friends. i have i simple c/c++ function that return the min of the array to the main function, in the body of the function i'm using an iterative loop so i would like to do it recursivly and i don't know from where to start! all reply are usefull … | |
//There is a problem in int main when scanning in the constructors into the pointer array ( found around line 843) //(sorts by the value generated in calcStockIndex — a method within the stock class) #include <iostream> #include <fstream> #include<cmath> using namespace std; /* Purpose: To store all information that … | |
Hi All, In below code when class a object is assigned to class b by returning object through factory method i observed assignment is not happening properly and after assignment still class b's object points to NULL object only. *cobj=rhs;//it gives NULL object However below statement works perfectly when b … | |
I tried to draw that shape but it doesnt work in right way .. any help? example for size = 3 print: * * *** * * #include<iostream> #include<cmath> using namespace std; int main() { int N, t,col,row; cin >> t; for (int i =0; i < t; i++) { … | |
write a c++ program that asks user to insert 2 numbers | |
Hi All, After compiling below code , I am getting below error. error: cannot convert a* to b* in assignment. it seems to be assignment doesn't work with pointers . Can anybody throw some light on this? i tried to use unique_ptr by transfering the ownership from a to b … |
The End.