Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Tuesday, February 16, 2010

Write the output for the following C program



#define p(a,b) (a+b)/2
main( )
{
int x=4, y=9, h;
x+=y++;
y*=3;
h=p(x,y);
printf("%5d %5d %5d\n", x, y, h);
}

Output :-
_ _ _ 13 _ _ _ 30 _ _ _ 21
read more "Write the output for the following C program"

Write the output for the following C program



#include<stdio.h>
main( )
{
int a, b;
for (a=2, b=4; a < 100; b+=4, a*=3)
{
a+=b;
printf("%4d", a);
}
}

Output :-
_ _ _ 6 _ _ 26 _ _ 90
read more "Write the output for the following C program"

Write the output for the following C program ?



main( )
int x=3, y=5, n;
while (y < 30)
{
n=x+y;
printf("%3d", n);
x=y;
y=n;
}
}

Output :-
_ _ 8 _ 13 _ 21 _ 34
read more "Write the output for the following C program ?"

Write the output for the following C program



#define h(a , b) a > b ? a : b
main( )
{
int x=25, y=33, z=10;
x+=3*y++;
y*=3;
z+=h(x,y);
printf("%d \n %d\n %d \n", x, y, z);

Meaning :-
h(a,b) = a if condition a >b is true.
h(a,b) = b if condition a >b is not true.

Output
124
102
134
read more "Write the output for the following C program"

Write the output for the following C program



#define f(x) x > = 0 ? "real" : "complex"
main( )
{
int a=2, b=7, c=7, d;
d = (b*b-4*a*c);
printf("\n d is a %s values", f(d));
}

Meaning:-
f(x) will be real if x>0
f(x) will be complex if the above condition is not true.

Output :-
d is a complex values
read more "Write the output for the following C program"

Thursday, February 11, 2010

Write the output for the following C program



main( )
{
int a = 2, s = 0, j = 1;
for ( ; a < 10; a+=3, j++)
{
s += a * a * a;
printf("\n a = %d j = %d", a, j);
}
printf("\n j=%d a=%d s=%d", j, a, s);
}


























Output


a=2
j=1

a=5
j=2

a=8
j=3

j=4
a=11
s=645
read more "Write the output for the following C program"

Write a output for the following c program



#include<stdio.h>
main( )
{
int x = 6589;
char z = '*';
float y = 8888.9935;
printf("% -6.1f %3c\n", y, z);
printf("% +5d % -3c\n", x, z);
}

Ouput:-

8889.0 _ _ *
+6589 * _ _
read more "Write a output for the following c program"

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP