manish soni


{ City } jaipur
< Country > india
* Profession * student
User No # 66360
Total Questions Posted # 0
Total Answers Posted # 33

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 170
Users Marked my Answers as Wrong # 75
Answers / { manish soni }

Question { TCS, 12723 }

Find the output?
void main()
{float a=2.0;
printf("\nSize of a ::%d",sizeof(a));
printf("\nSize of 2.0 ::%d",sizeof(2.0));}


Answer

here a as a float so 4bytes
and 2.0 is work as double.
when 2.0f work as a flaot so .
sizeof(2.0f)is 4 byte

Is This Answer Correct ?    0 Yes 1 No

Question { 8187 }

find largest of 3 no


Answer

#include
#include
void main()
{
int a,b,c,max;
printf("Enter any 3 no");
scanf("%d %d %d",&a,&b,&c);
max=a>b?(a>c?a:c):(b>c?b:c);
printf("%d",max);
getch();
}

Is This Answer Correct ?    0 Yes 0 No


Question { 6491 }

Write a program that takes a 5 digit number and calculates 2
power that number and prints it


Answer

#include
#include
void main()
{
int n,p;
long int ans;
printf("Enter the number ans power");
scanf("%d %d",&n,&p);
ans=1;
while(p>0)
{
ans*=n;
p--;
}
printf("%ld",ans);
getch();
}

Is This Answer Correct ?    0 Yes 0 No

Question { 6491 }

Write a program that takes a 5 digit number and calculates 2
power that number and prints it


Answer

o/p is ;
enter the number 11111
2
123454321

Is This Answer Correct ?    0 Yes 1 No

Question { 5518 }

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


Answer

IN FUNCTION;
-------------------------------------------
1:)DECLARE: int sum(int);//close with semicolon;

2:)DEFINATION: int sum(int n)//not colse with semicolon;
{
//logic of the function;
}

Is This Answer Correct ?    2 Yes 0 No

Question { 5494 }

can please someone teach me how to create this program using
while statement.. this is the output should look like

0
2
4
6
8
10

-thanks.. :) need it asap...


Answer

#include
#include
void main()
{
int cnt,term;
cnt=0;
while(cnt<6)
{
cnt+=1;
term=(cnt*2-1)^1;
printf("%d\n",term);
}
getch();
}

manish soni tagore biotech collage jaipur

Is This Answer Correct ?    1 Yes 0 No

Question { KPIT, 15551 }

how c source file in converted to exe file


Answer

first
source file(file name or code program)--complile-->object
file(filename.bak)----excute----->.exe(fliename.exe)

Is This Answer Correct ?    1 Yes 10 No

Question { Burning Glass, 14246 }

#include
#include
# define swap(a,b) temp=a; a=b; b=temp;
void main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
swap( i, j );
printf( "%d %d %d", i, j, temp);
}


Answer

my dear frd....
here some hapen.
#define swap(a,b) temp=a;a=b;b=temp;----------(1)
is was as function of swap two no;(but it is differnt frm
funtion.)
so
at i>j;
enter swap(i,j);
so jump at eq(n) ---(1) and call swap function'
and


temp=5;


i=10;
j=0;

you see three variable.
but it printf i,j to convert swap.
bcoz it have two arguments.
and print temp=0;
becoz temp have 0;

Is This Answer Correct ?    0 Yes 7 No

Question { 4949 }

Sir,please help me out with the output of this programme:-

#include
#include
void main()
{
int a=18,b=12,i;
for(i=a printf("%d %d",i);
}


Answer

hi frds,manis soni tagore collage jaipur
in this prm,
initily
for(i=12;a%i||b%i;i--);
--------|-------|--------|
a%i | b%i | i--;|
--------|-------|--------|
18%12=6*|** |12--=11;|
--------|-------|--------|
18%11=7*|** |11--=10;|
--------|-------|--------|
18%10=8*|** |10--=9; |
--------|-------|--------|
18%9=0 *|12%9=3 |9--=8; |
--------|-------|--------|
18%8=2 *|** |8--=7; |
--------|-------|--------|
18%7=4* |** |7--=6; |
--------|-------|--------|
18%6=0 *|12%6=0 |***; |
--------|-------|--------|
summory of the program
here we dissuss sum property
-----------------------------------
coition1||(or operaor)conditon 2;
-----------------------------------
in this case if condition1 is ture then
the second condition will not excute;
this is property of OR opr.
------------------------------------
here->(*)is represent condition1 and
------------------------------------
2.if c1 is false then c2 is true
this is represent **.
--------------------------------------
if c1 and c2 both are false then
***.
this is termination point.
and print 6;
bcoz at 6 both the condition are false.

Is This Answer Correct ?    0 Yes 0 No

Question { 4397 }

#include
#include
void main()
{
char ch='\356';
printf("%d",ch);
}
o/p=-18 why?plz.explain


Answer

in place of 356 we i/p and see o/p;
i/p o/p
0-7 0-7

8-9 56-57

10-17 8-15

Is This Answer Correct ?    0 Yes 1 No

Question { 5758 }

can v write main()
{
main();
}
Is it true?


Answer

it is recursive function.
here is no condition is apply so
the result is
infintely.
and after that 'the statck memory flow'.
conditio is start.


manish soni tagore bio tech collage,
jaipur

Is This Answer Correct ?    2 Yes 0 No

Question { 8950 }

what will be the output of "printf("%d%d",scanf("%d%
d",&a,&b))".provide an explation regarding the question


Answer

if we enter
1234
5678
answer is
2 5678
plz tell how

Is This Answer Correct ?    2 Yes 1 No

Question { 8950 }

what will be the output of "printf("%d%d",scanf("%d%
d",&a,&b))".provide an explation regarding the question


Answer

what is output of this program
#include
#include
void main()
{
int a,b;
a=10;
b=20;
printf("%d %d");
getch();
}

it gives the 20 10;
bcoz printf fn return which value,
read recently ,reversely.
so above question we easly explain.
that;-
so scanf fn return which value process it.
scanf fn return 2 and after return value of b.


manish soni bca 3rd year jaipur tagore college

Is This Answer Correct ?    2 Yes 0 No

Question { 5004 }

find the minimum of three values inputted by the user


Answer

#include
#include
void main()
{
int a,b,c,min;
printf("Enter the 3 values");
scanf("%d %d %d",&a,&b,&c);
if(a {
if(a min=a;
else
min=c;
}
else
{
if(b min=b;
else
min=c;
}
printf("the minimum numbers of %d,%d and %d is=%
d",a,b,c,min);
getch();
}

Is This Answer Correct ?    4 Yes 0 No

Question { 5004 }

find the minimum of three values inputted by the user


Answer

#include
#include
void main()
{
int a,b,c,min;
printf("Enter the 3 values");
scanf("%d %d %d",&a,&b,&c);
min=a printf("the minimum numbers of %d,%d and %d is=%
d",a,b,c,min);
getch();
}

Is This Answer Correct ?    2 Yes 0 No

Prev    1    [2]   3    Next