You can also try modifyimg the following linesin your code
while(t != -999)
{
scanf("%d", &t);
if(t != -999)
{
temp_readings[count]= t;
count++;
}
as
scanf("%d", &t);
while(t != -999)
{
temp_readings[count]= t;
count++;
scanf("%d", &t);
}
User Profile
Collapse
-
In your program j is int that is nothing but the signed int and length funtion returns unsigned int. To avoid this warning you have to make both of same type.
If you declare j as unsigned int then the warning will not come or you will have to do cast conversion of return type of length function.Leave a comment:
-
-
-
-
switch case structure is replacemet for if-else if....-else structure
try the following code
switch (response)
{
case 'y':
cout<< "Your request is being processed"<< endl;
break;
case 'n':
cout<<" Thank you anyway for your consideration" << endl;
break;
case 'h':
cout<<"Sorry, no help is currently...Leave a comment:
-
You have been asked to use type long int to store the input number number read in…so you get a lot of digits.
The input for your program is a number that should be declared as long int so that you can have long number containing more digits.
The Logic I can explain you then you try to put it in program
Use one more array of size 10 corresponding to digits 0 to 9 which stores the count of the corresponding digits..........Leave a comment:
-
unless and untill you start something no one is going to help you. You try first and then ask if you have any queries.Leave a comment:
-
Exception Handling
How can we do exception handling for declaring object of the class in C++? -
strcpy ends copying of data when it reaches NULL character (Say, '\0' or 0) and then copies NULL at the end of destination data. It is specifically used to copy strings (char[]).
memcpy can be used to copy any type of data (void*). It terminates at the byte position specified by the third parameter.Leave a comment:
-
A dangling pointer is a pointer to storage that is no longer allocated.Leave a comment:
-
-
-
try the code given below and let me know the result
for (i=1;i<=k;i++)
{
for (j=1;j<=m;j++)
cout<<"*";
cout<<endl;
m+=2;
}Leave a comment:
-
hi
#define q(k)main(){ return!puts(#k" \nPRABUq("#k")" );}
q(#define q(k)main(){retu rn!puts(#k"\nq( "#k")");})
the above code will be converted into following code after preprocessing
here k = #define q(k)main(){retu rn!puts(#k"\nq( "#k")");}
and we have defined q(k) in the first line
just substitue k in the text following...Leave a comment:
-
-
C++ code in c prog
Can we use c++ code in c prog or can we include .cpp in c prog. ? If yes ........ How can we do this? -
-
Yes you are right....the file should already be created with 10 numbers in it
no output will be shown on console but after running the code when you open myoutput.txt if you find the desired output then it means it is working fine.Leave a comment:
-
Try this
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int num;
int positivecount, negativecount, sumneg, sumpos;
ofstream outfile;
ifstream infile;
string filename;
positivecount=0 ;
negativecount=0 ;
sumneg=0;
sumpos=0;
cout << "enter...Leave a comment:
No activity results to display
Show More
Leave a comment: