ankur mohan sharma


{ City } noida
< Country > india
* Profession *
User No # 61515
Total Questions Posted # 2
Total Answers Posted # 3

Total Answers Posted for My Questions # 4
Total Views for My Questions # 7755

Users Marked my Answers as Correct # 3
Users Marked my Answers as Wrong # 5
Questions / { ankur mohan sharma }
Questions Answers Category Views Company eMail

What is diffrance between declaration and defination of a variable or function

4 C 5860

A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

C 1895




Answers / { ankur mohan sharma }

Question { 4222 }

what is the output of following question?

void main()
{
int i=0,a[3];
a[i]=i++;
printf("%d",a[i]
}


Answer

A garbage value
Explanaiton:-since we have post increment operator applied on i. It's value gets incremented in next statement, so
a[i]=i++ means a[0]= 0
so a[0] is assigned value 0;
and now i becomes 1;
In next statement value of a[i] is to be printed which means value of a[1], which is not initialised. So value printed is a
garbage value.
Remarks
1. An uninitialised variable holds a garbage value.
2. Post increment operator increments value in next line.

Is This Answer Correct ?    0 Yes 0 No

Question { 5814 }

In which category does main function belong??


Answer

Main is a user defined function.
It has an important property that it is first recognised by compiler. So it must be present in a program.
A user defined function is one whose defination is given by user and Since you define main's working. So it is a user defined function.

Is This Answer Correct ?    1 Yes 0 No


Question { IBM, 40466 }

Write a program to print prime nums from 1-20 using c
programing?


Answer

#include
#include
int main()
{
int i,n;
for(n=2;n<=20;n++)
{
for(i=2;i {if(n%i==0)
break;}
}
if(i==n)
printf("\n %d",n);
return 0;

}

Is This Answer Correct ?    2 Yes 5 No