free geoip

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
something is wrong with this version of dev c++
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
Subject: something is wrong with this version of dev c++
sir i seriously doubt there is some problem with this d++ compiler... it doesnt compile correct commands and gives problems...fir instance,,, im job doin person... this sunday i was rehearsing exercises and from lecture 6 i wrote this program as: using namespace std; #include main() { int sum,number; sum=0; number=1; while (number<=1000) { sum=sum+number; number=number+1; } cout<<"THE SUM OF FIRST 1000 INTERGERS STARTING FROM 1 IS:"< header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated. if sumthing wrong with this compiler please provide and apply dev c++ v4.0 which is also been used in lecture videos... i am seeing almost every student here struggling with running the program... please take my sincere request under consideration... i will be very thankful to you.
Reply
#2
Dear Student,
It may not necessarily be a problem with your Dev C++ IDE. The difference in the version of Dev does not make much of an affect. I think that the issue is with the code which you are compiling may contains soem syntax errors. Another important thing you should keep in mind is to add the line using namespace std; at the top of your each program and also write the following line system("pause"); before the closing curly brace '}' of the program.

Below is the correct code of the above mentioned program. Just compile and run it to see if it works.

#include <iostream.h>

using namespace std; // this line was missing in your code

main()
{
int sum, number;


sum = 0;
number = 1;

while(number <= 1000)
{
sum = sum + number;
number = number + 1;
}
cout << "The sum of first 1000 integers starting from 1 is " << sum;

system("pause");// this line should also be written to halt the output screen so that you can see the program output
}
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Version Problem sana.pari 1 1,593 04-24-2011, 07:21 PM
Last Post: Support

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support