- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
setting a goal and setting your mind on it moves you like an arrow
- Interests
- programming, music, 1's & 0's
13 Posted Topics
Re: #include<stdio.h> int main(){ int num; printf("please enter your number\n"); scanf("%d",&num); if(num>0&&num<10){ int ans = num; printf("the answer is %d", ans); } else if(num>=10&&num<100){ int remdr = num%10; int tens = num/10; int ans = remdr + tens; printf("the answer is %d + %d = %d\n", tens,remdr,ans); } else if (num>=100&&num<1000){ … | |
Re: lol.. seriously?? you want a whole game by simply typing that sentence? sorry! | |
please i have a little problem creating a class and making it run. The class is created separately as a header file with it's source code. whenever i build the source code of the class, i get an error that says: undefined reference to 'WinMain@16'. And whenever I run the … | |
Re: well, check this out.. as per your code, I've corrected a few things but it doesn't answer your homework sorry. Like he rightly said, it's not done here... see if you can build on it | |
#include<iostream> using namespace std; int main(){ int fish =6; int * fishp = &fish; cout<<fishp<<endl; return 0;} this runs ok, but i get the same memory address when i cout either fishp or &fishp. how is it possible for a pointer to have the same address as the address it's … | |
Re: why didn't you just use cin to take the strings instead of the getline.. anyway try this if it's the outcome u want. It's not so different from yours #include <iostream> #include <string> using namespace std; int main() { int admno; string studentname; string Addresscode; string telephonenumber; do { cout<<"\n\nplease … | |
Re: and where is your code if I may ask, I suppose u're asking for help and not giving as a "project" | |
Re: :) i like this place... "helping you to learn to code, not to get you the code" | |
Re: first i'll post the corrected one.. then i'll talk about your mistakes :) #include <iostream> #include "windows.h" #include <cmath> #include <iomanip> using namespace std; double Hypotenuse(double sideA, double sideB); /*********************************************/ double Hypotenuse(double sideA, double sideB) { double hypotenuse = 0.0; hypotenuse= sqrt((sideA*sideA)+(sideB*sideB)); return hypotenuse; } int main() { double sideA=0.0; … | |
Re: please consider this an insult to programming.. Don't make it a habit | |
Re: #include<iostream> using namespace std; int main(){ float arr[10]; cout<<"please enter 10 numbers"<<endl; for(int i=0; i<10; i++){ cin>>arr[i]; } for(int i=0; i<9; i++){ int small = i; for(int j=i+1; j<10; j++){ if(arr[j]<arr[small]) small = j; } if(arr[i]!=arr[small]) swap(arr[i],arr[small]); } cout<<"\nThe greatest number is "<<arr[9]<<endl; return 0;} make sure you understand the … | |
Re: you have redeclared star and stars as int in the for loop.. you should find another way to make it print stars since you can't use char neither | |
Re: #include <iostream> using namespace std; int main(){ int i, j, N=7; for(i=1; i<=(0.5*N+1); i++){ for(j=1;j<=i; j++){ cout<<"*";} cout<<"\n";} for(i=(0.5*N); i<=N; i++){ for(j=(N-1); j>i; j--){ cout<<"*";} cout<<"\n";} return 0;} |
The End.