0% found this document useful (0 votes)
67 views

Assignment 5 Printf in C Programming 1

This document contains 16 questions about C programming and the printf() function. It provides code snippets testing different uses of printf(), including printing multiple strings, escape characters, return values, nested printf() statements, and scanf(). The questions aim to find the output of the given code examples and understand how printf() works in various situations.

Uploaded by

Deep Raj Jangid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Assignment 5 Printf in C Programming 1

This document contains 16 questions about C programming and the printf() function. It provides code snippets testing different uses of printf(), including printing multiple strings, escape characters, return values, nested printf() statements, and scanf(). The questions aim to find the output of the given code examples and understand how printf() works in various situations.

Uploaded by

Deep Raj Jangid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

C Programming

Assignment 5
Q1.

Q2.

Q3.

Q4.

Q5.

Q6.

printf() in c programming

Find output of given examples


a.
printf (hello);
b.
printf (Happy Sunday);
c.
printf (Happy New
Year);
d.
printf (hello
friend);
e.
printf (THE, TIMES,
OF, INDIA );
#include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("%dhello",a*2);
printf("\n c=%d",c);
}
#include<stdio.h>
void main()
{
int a=50, b=5, c=0;
b=printf("%d%d",a,b);
printf("\n b=%d",b+2);
}
#include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("%#o",a+b+10);
printf("\n c=%c",c);
}
#include<stdio.h>
void main()
{
int a=50, b=5, c=0;
a=b=c=printf("%d",a);
printf("\n b=%d",b);
}
#include<stdio.h>
void main()
{
int a=50, b=5, c=0;

c=printf("%d"a+b);
printf("\n c=%d",c);
}
Q7.

Q8.

Q9.

#include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("%x",-1);
printf("\n c=%d",c);
}
#include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("\\\n");
printf("\n c=%d",c);
}
#include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("\my\new\friend");
printf("\n c=%d",c);
}

void main()
{
int a=50, b=5, c=0;
c=printf("Happy=
%d",printf("Hello""%d",printf("%c",a+b+1
0)));
printf("\n c=%d",c);
}
Q13. #include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("Tom=%d and Jerry=
%d",printf("\new\bike",printf("%d",a)));
printf("\n c=%d",c);
}
Q14. #include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("Harry=
%d",printf("potter=
%d",scanf("%dxyz",&a)));
printf("\n c=%d",c);
}

Q10. #include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("Happy\nSunday
%d",'A'+32);
printf("\n c=%d",c);
}

Q15. #include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("\ra.one=%d",scanf("5
%d",&a,&b));
printf("\n c=%d",c);
}

Q11. #include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("%%%d"sizeof(0xFFFF));
printf("\n c=%d",c);
}

Q16. #include<stdio.h>
void main()
{
int a=50, b=5, c=0;
c=printf("\my=
%d",printf("\name=%d",printf("\anthony=
%d",printf("\gansdvis"))));
printf("\n c=%d",c);
}

Q12. #include<stdio.h>

Designed by Er. Deep Raj Jangid

You might also like