TyBcom.com Logo  
 Home
Navigation
 
Sponsors

 
Search
Google

Web TyBcom.com
Predict The Output
 

Predict the output for following "C" Programs

Program # 1

#include<stdio.h>
#include<conio.h>
int h(int,int,int);
int h(int a,int b,int c)
{
int d;
if(
a>&& a>cd=a;
else if (
b>cd=b;
else 
d=c;
return 
d;
}
main()
{
int x=2,y=6,z=9,p,q;
clrscr();
p=h(x,y,z);
x*=2;y+=7;
q=h(x,y,z);
printf("\n%d %d\n",p,q);
getch();
}

Output : 9 13
Top
Program # 2

#include<stdio.h>
# define EOT '\0'
main()
{
char n[20] = "aradhana";
int c=0;
while(
n[c]!=EOT)
    {
    if(
n[c]=='a')n[c]='+';
    
c++;
    }
puts(n);
}

Output : +r+dh+n+
Top
Program # 3

#include<stdio.h>
#include<conio.h>
void main()
{
int k=15,s;
clrscr();
for(
s=0;k<50;s+=k,k+=10);
printf("\n%d \n",s);
getch();
}

Output : 120
Top
Program # 4

#include<stdio.h>
#include<conio.h>
main()
{
int x,y=3;
clrscr();
for(
x=2;x<10;x+=2)
    {
    
printf("\n%4d %4d\n",x,y);
    
y*=x;
    if(
y>150)break;
    }
getch();
}

Output :
2 3
4 6
6 24
8 144
Top

Quick Links : C Language Programs | FoxPro Programs | Predict The Output
Concept & Design : Web1 
- Home - Notes N' Tips - University Papers - Notice Board - Discussion Forums - Career Options - Express It - Contact Us -
Copyright 2017 TyBcom.com. All Rights Reserved.