- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- Interests
- C++,C,OS
6 Posted Topics
Re: what do u mean by having two test variables?? two classes having the same name or two different classes having the same function name.... | |
1. #include<stdio.h> #include<conio.h> int main() int a=10; printf("%d%d%d",a,a++,++a); getch(); return 0; } o/p:12 11 11 #include<stdio.h> #include<conio.h> int main() { double a=5.2; if(a==5.2) printf("equal"); else if(a<5.2) printf("less"); else printf("high"); getch(); } o/p: less Can any one give me explanation for the above outputs..... | |
Re: #include<iostream.h> #include<conio.h> void prime(); int main() { prime(); getch(); } void prime() { int i=0,j=0,k=0,l=0,m=0,n=0,g[20],count=0,v=0; cout<<"Enter integer"; cin>>n; while(m<=n) { for(i=1;i<=n;i++) { if(m%i==0) count++; } if(count == 2) { g[k]=m; k++; } count=0; m++; } for(l=0;l<k;l++) { for(v=0;v<k;v++) { j=g[l]+g[v]; if(j==n) cout<<g[l]<<" "<<g[v]<<endl; } } } this will be useful … | |
Re: your mistake is you used m_wage and m_hours directly....but you can acces them through object only so you have to give person1.m_wage and person1.m_hours in 34 and 35 lines.... and the second thing is in the 22 line... you have to declare that inside the class.... and the third thing … | |
Re: try like this If(head==N-1) { printf("queue is full"); } if(head==-1) { printf("queue is empty"); } and try to give the queue values dynamically....if u r giving statically means you willl nt get a chance for testing the error.... | |
Re: #include<iostream.h> #include<conio.h> class generator { public: int a,i; void display(); generator() { a=0;i=0; } }; void generator::display() { a=10; for(i=1;i<=3;i++) { a=10*i; cout<<a<<"\n"; } } int main() { generator b; b.display(); getch(); } |
The End.