i have changed the lineno 7 and 13. it will work.. check
main();
{
int a[100], n, i;
printf("Enter the number of elements\n");
scanf("%d", &n);
for(i=0; i<n; i++)
{
scanf("%d", &a[i]);
}
for(i=0; i<n; i++)
{
if(a[i]%2==0)...
User Profile
Collapse
-
yes it is true that clrscr() function will be in conio.h
but some times compiler will include this hedder file automatically, i have faced same situation 2years back.Still its our responsibility to include all hedder files where our function definitions are there.
so dont waste time on this things.Leave a comment:
-
thanks a lot for all ur replys..
after reading all messages(9,12,1 5)
the const variable which is declare in main will save in either code sigment or in flashmem(i accept this two :-)
no my question is:
in case of flashmemory we cannot change it because it is read only so leave that part
in case of codesigment:
after refering all C books " the variable wich is declare as CONST is saved...Leave a comment:
-
-
fine tassos
const int var =10;
int *p=&var;
*p=15;
if i print the value of var i will give 15 right??
here what my question is we are changing the value saved in "code sigment" that is readonly memory "var" how its possible..
hope i understood what i'm tell right??
please let me know if not??...Leave a comment:
-
yes.. that was my proble only.. but here we are changing the value saved in code sigment right?? how its possible??...Leave a comment:
-
-
for (;a!=0;a=a>>1)
st1;
first compiler check the value of a; if it is not equal to zero it will proced after that st1 will execute then a will be right shift(>> is a right shift operator) once i.e lets take a value is 8, then binary is 1000 after right shift it will be 0100, so compiler will check the a value again now its value is 4, it will repeate till a value zero.Leave a comment:
-
how this is possible in c(const variable)
hi to all
i have stuggled a lot with the below code. just see the code and explanation and please tell me ur input on this
i have a code like this
void main()
{
const int i=10;
int *p=&i;
*p++;
Printf("%d",i);
}
value it will display is 10.
so here my question is accoriding to dennis the variable wich declare as const will... -
that all depends on ur interest. start doing practice in different style you will get it very soon..Leave a comment:
-
It should work.
call by referece means you have to take like that only
void mul(int a, int& sum)
{
sum=a*a;
}
void main()
{
int a=10;
int sum;
mul(a,sum);
printf("%d",sum );
}
in this case i will print 100 thats sure.. i wont give any error try this agian and let me know if not............ ...Leave a comment:
-
-
namespace is the user space where we can define our own data types.
main use of namespace is to reduce the configs of global. let me explain in detail when we try to declare the global variable, if the same name already exits then we gets the problem, so to avoid this confilgs c++ allowing users to create our own namespace where we can declare our global variables and we can include this namespace in the program.
using namespace vinay;...Leave a comment:
No activity results to display
Show More
Leave a comment: