20. Find the output for the following C program
#include <stdio.h>
void main(void)
{
int y,z;
int x=y=z=10;
int f=x;
float ans=0.0;
f *=x*y;
ans=x/3.0+y/3;
printf("%d %.2f",f,ans);
}
21. Find the output for the following C program
#include <stdio.h>
void main(void);
{
double dbl=20.4530,d=4.5710,dblvar3;
double dbln(void);
dblvar3=dbln();
printf("%.2ft%.2ft%.2fn",dbl,d,dblvar3);
}
double dbln(void)
{
double dblvar3;
dbl=dblvar3=4.5;
return(dbl+d+dblvar3);
}
22. Find the output for the following C program
#include <stdio.h>
static int i=5;
void main(void)
{
int sum=0;
do
{
sum+=(1/i);
}while(0);
printf("%d",sum);
}
23. Find the output for the following C program
#include <stdio.h>
void main(void)
{
int oldvar=25,newvar=-25;
int swap(int,int);
swap(oldvar,newvar);
printf("Numbers are %dt%d",newvar,oldvar);
}
int swap(int oldval,int newval)
{
int tempval=oldval;
oldval=newval;
newval=tempval;
}
24. Find the output for the following C program
#include<stdio.h>
void main(void);
{
int i=100,j=20;
i++=j;
i*=j;
printf("%d\t%dn",i,j);
}
25. Find the output for the following C program
#include <stdio.h>
void main(void);
int newval(int);
void main(void)
{
int ia[]={12,24,45,0};
int i;
int sum=0;
for(i=0;ia[i];i++)
{
sum+=newval(ia[i]);
}
printf("Sum= %d”,sum);
}
int newval(int x)
{
static int div=1;
return(x/div++);
}
26. Find the output for the following C program
#include <stdio.h>
void main(void);
{
int v1,v2,v3,minmax;
v1=5;
v2=5;
v3=6;
minmax=(v1>v2)?(v1>v3)?v1:v3:(v2>v3)?v2:v3;
printf(”%dn”,minmax);
}
27. Find the output for the following C program
#include <stdio.h>
void main(void);
{
void pa(int *a,int n);
int arr[5]={5,4,3,2,1};
pa(arr,5);
}
void pa(int *a,int n)
{
int i;
for(i=0;i
printf("%dn",*(a++)+i);
}
28. Find the output for the following C program
#include <stdio.h>
void main(void);
static int i=50;
int print(int i);
void main(void)
{
static int i=100;
while(print(i))
{
printf("%dn",i);
i-–;
}
}
int print(int x)
{
static int i=2;
return(i–);
}
29. Find the output for the following C program
#include <stdio.h>
void main(void);
typedef struct Ntype
{
int i;
char c;
long x;
}NewType;
void main(void)
{
NewType *c;
c=(NewType*)malloc(sizeof(NewType));
c->i=100;
c->c='C';
(*c).x=100L;
printf("(%d,%c,%4Ld)",c->i,c->c,c->x);
}
30. Find the output for the following C program
#include <stdio.h>
void main(void);
const int k=100;
void main(void)
{
int a[100];
int sum=0;
for(k=0;k<100;k++)
*(a+k)=k;
sum+=a[–k];
printf("%d",sum);
}
31. if base address of array a is 65584
#include <stdio.h>
void main()
{
int a[5]={2,1,4,7,8};
clrscr();
printf("%u\t%u", a+1,&a+1);
getch();
}
32. Print value of i ?
#include <stdio.h>
void main()
{
int i=1*4/3-27%3^2+100*0.5(4>3?1:2);
clrscr();
printf("%d", i);
getch();
}
33. write output of program.
#include <stdio.h>
void main()
{
int a[5]={2,1};
clrscr();
printf("%\d\t%d\t%d", a[3],a[4],a[2]);
getch();
}
34. write output of program.
#include <stdio.h>
void main()
{
int a=2,b=3,c,d;
clrscr();
c=a++||++b;
d=++a&&b++;
printf("%d\t%d", c,d);
getch();
}
35. write output of program.
#include<stdio.h>
void main()
{
int a=2,b=3;
clrscr();
for(i=1;i<3;i++)
{
printf("%d",a);
continue;
printf("%d",b);
break;
}
getch();
}
36. Are both free() and delete() used for deaollocation of memory.
37. It is better to implement tree using_______?
a)stack b)array c)LL d)structures
38. write output of program.
#include <stdio.h>
void main()
{
extern int i;
i=20;
printf("%d",i);
}
39. write output of program.
#include <stdio.h>
void main()
{
float me=0.7;
double you=0.7;
if(me==you)
printf("I luv u");
else printf("I hate u");
}
<<previous
#include <stdio.h>
void main(void)
{
int y,z;
int x=y=z=10;
int f=x;
float ans=0.0;
f *=x*y;
ans=x/3.0+y/3;
printf("%d %.2f",f,ans);
}
21. Find the output for the following C program
#include <stdio.h>
void main(void);
{
double dbl=20.4530,d=4.5710,dblvar3;
double dbln(void);
dblvar3=dbln();
printf("%.2ft%.2ft%.2fn",dbl,d,dblvar3);
}
double dbln(void)
{
double dblvar3;
dbl=dblvar3=4.5;
return(dbl+d+dblvar3);
}
22. Find the output for the following C program
#include <stdio.h>
static int i=5;
void main(void)
{
int sum=0;
do
{
sum+=(1/i);
}while(0);
printf("%d",sum);
}
23. Find the output for the following C program
#include <stdio.h>
void main(void)
{
int oldvar=25,newvar=-25;
int swap(int,int);
swap(oldvar,newvar);
printf("Numbers are %dt%d",newvar,oldvar);
}
int swap(int oldval,int newval)
{
int tempval=oldval;
oldval=newval;
newval=tempval;
}
24. Find the output for the following C program
#include<stdio.h>
void main(void);
{
int i=100,j=20;
i++=j;
i*=j;
printf("%d\t%dn",i,j);
}
25. Find the output for the following C program
#include <stdio.h>
void main(void);
int newval(int);
void main(void)
{
int ia[]={12,24,45,0};
int i;
int sum=0;
for(i=0;ia[i];i++)
{
sum+=newval(ia[i]);
}
printf("Sum= %d”,sum);
}
int newval(int x)
{
static int div=1;
return(x/div++);
}
26. Find the output for the following C program
#include <stdio.h>
void main(void);
{
int v1,v2,v3,minmax;
v1=5;
v2=5;
v3=6;
minmax=(v1>v2)?(v1>v3)?v1:v3:(v2>v3)?v2:v3;
printf(”%dn”,minmax);
}
27. Find the output for the following C program
#include <stdio.h>
void main(void);
{
void pa(int *a,int n);
int arr[5]={5,4,3,2,1};
pa(arr,5);
}
void pa(int *a,int n)
{
int i;
for(i=0;i
printf("%dn",*(a++)+i);
}
28. Find the output for the following C program
#include <stdio.h>
void main(void);
static int i=50;
int print(int i);
void main(void)
{
static int i=100;
while(print(i))
{
printf("%dn",i);
i-–;
}
}
int print(int x)
{
static int i=2;
return(i–);
}
29. Find the output for the following C program
#include <stdio.h>
void main(void);
typedef struct Ntype
{
int i;
char c;
long x;
}NewType;
void main(void)
{
NewType *c;
c=(NewType*)malloc(sizeof(NewType));
c->i=100;
c->c='C';
(*c).x=100L;
printf("(%d,%c,%4Ld)",c->i,c->c,c->x);
}
30. Find the output for the following C program
#include <stdio.h>
void main(void);
const int k=100;
void main(void)
{
int a[100];
int sum=0;
for(k=0;k<100;k++)
*(a+k)=k;
sum+=a[–k];
printf("%d",sum);
}
31. if base address of array a is 65584
#include <stdio.h>
void main()
{
int a[5]={2,1,4,7,8};
clrscr();
printf("%u\t%u", a+1,&a+1);
getch();
}
32. Print value of i ?
#include <stdio.h>
void main()
{
int i=1*4/3-27%3^2+100*0.5(4>3?1:2);
clrscr();
printf("%d", i);
getch();
}
33. write output of program.
#include <stdio.h>
void main()
{
int a[5]={2,1};
clrscr();
printf("%\d\t%d\t%d", a[3],a[4],a[2]);
getch();
}
34. write output of program.
#include <stdio.h>
void main()
{
int a=2,b=3,c,d;
clrscr();
c=a++||++b;
d=++a&&b++;
printf("%d\t%d", c,d);
getch();
}
35. write output of program.
#include<stdio.h>
void main()
{
int a=2,b=3;
clrscr();
for(i=1;i<3;i++)
{
printf("%d",a);
continue;
printf("%d",b);
break;
}
getch();
}
36. Are both free() and delete() used for deaollocation of memory.
37. It is better to implement tree using_______?
a)stack b)array c)LL d)structures
38. write output of program.
#include <stdio.h>
void main()
{
extern int i;
i=20;
printf("%d",i);
}
39. write output of program.
#include <stdio.h>
void main()
{
float me=0.7;
double you=0.7;
if(me==you)
printf("I luv u");
else printf("I hate u");
}
<<previous