What is the output of the following C Program?
![]()
Practice Declarations and Initializations – What is the output of the following C Program?
#include
void main()
{
int a=4, b = 6;
printf ("%d", a==b);
} ![]()
Practice Declarations and Initializations – What is the output of the following C Program?
#include
void main()
{
int a=4, b = 6;
printf ("%d", a==b);
} ![]()
Practice Control Instructions – What is the output of the following C Program?
#include
void main()
{
for (i =1,j = 10; i < 6; ++i, - -j)
printf("%d%d", i,j);
} ![]()
Practice Expressions – What will be output of the following “c” code?
#include
void main()
{
printf("%d",++5);
} ![]()
Practice Declarations and Initializations – What is the output of the following “c” program ?
#include
void main()
{
int i = 107, x = 5;
printf ((x > 7)? "%d" : "%c:, i)
} ![]()
Practice Control Instructions – What is the output of the following program ?
#include
void main()
{
int i= 5;
do {
putchar (i + 100);
printf("%d", i--);
}while(i);
} ![]()
Practice Declarations and Initializations – What is the output of the following program ?
#include
void main()
{
int i= 5;
if (i == 5)
return 0;
else
printf("i is not five");
printf("over");
} ![]()
Practice Declarations and Initializations – What is the output of the following program ?
void main()
{
printf("%d",10?0?5:1:12);
} ![]()
Practice Control Instructions – What is the output of the following C Program?
void main() {
for(i = 1; i < 5; i++)
{
if (i == 3)
continue;
else
printf ("%d", i);
}
} ![]()
Practice Expressions – What will be the output of the below C program.
#include
int main()
{
int i = 0;
for(i = 3; i < 15; i + = 3)
{
print{("%d", i);
++i;
}
return 0;
} ![]()
Practice Arrays – Which of the following statements is true after execution of the program
int a[l0],i,*p;
a[0]=1;
a[1]=2;
p=a;
(*p)++; ![]()
Practice Command Line Arguments – If the following program (Helloprog) is run from the command line as HelloProg 1 2 3. what would be the output?
main (int argc, char*argv[])
{
int i;
i = argv[1] + argv [2] + argv [3];
printf("%d", i);
} ![]()
Practice Structures, Unions, Enums – How do you modify the below structure to have less size in view of byte padding?
typedef struct emp
{
int emp_code;
char* emp_name;
char grade;
double salary;
char gender;
struct emp* link;
}employee; ![]()
Practice Variable Number of Arguments – What will be output of the following “c” code?
#include
void main(){
float a=5.2;
if(a==5.2)
printf("Equal");
else if(a<5.2)
printf("Less than");
else
printf("Greater than");
} ![]()
Practice Functions – What will be output of the following “c” code?
#include
int main(){
int i=3,val;
val=sizeof (f(i)+ +f(i=1)+ +f(i-1));
printf("%d %d",val,i);
return 0;
}
int f(int num){
return num*5;
} ![]()
Practice Arrays – What will be output of the following “c” code?
#include
int main(){
int arr[3]={10,20,30};
int x=0;
x=++arr[++x]+ ++x+arr[--x];
printf("%d ",x);
return 0;
}