0% found this document useful (0 votes)
73 views3 pages

Set-1 PC Fundamentals Home Assignment

This document provides programming questions and exercises in C language fundamentals including operators and expressions. It covers topics like data types, constants, input/output functions, conditional statements, loops, functions, arrays and pointers with examples. Some questions ask to write programs to perform tasks like converting between measurement units, calculating mathematical values like average/percentage, and flowcharts for algorithms. The document is intended to help students learn C programming basics through practice problems and exercises.

Uploaded by

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

Set-1 PC Fundamentals Home Assignment

This document provides programming questions and exercises in C language fundamentals including operators and expressions. It covers topics like data types, constants, input/output functions, conditional statements, loops, functions, arrays and pointers with examples. Some questions ask to write programs to perform tasks like converting between measurement units, calculating mathematical values like average/percentage, and flowcharts for algorithms. The document is intended to help students learn C programming basics through practice problems and exercises.

Uploaded by

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

School of Computer Engineering, PROGRAMMING IN C

KIIT University, Bhubaneswar (Fundamentals, Operators & Expressions)

Fundamentals of C language/ Operators {


& Expressions (SHORT TYPE) int a=3, b= -4;
printf ("%d", a%b+a*b%a);
1.1 Find out Differentiate between primary return 0;
memory and secondary memory. }
1.2 What is the difference between RAM and
ROM? 1.15 What will be output of the following c
1.3 Write the difference between high level program?
language and assembly language. #include<stdio.h>
1.4 Write any two advantages of compiler over int main()
interpreter. {
1.5 What is the difference between linker and loader. int a=3, b= -4;
1.6 Do as directed. printf ("%d", a*b-a%b/a);
a) Convert (342.56)10 to it's binary, octal and return 0;
hexadecimal equivalent separately. }
b) Convert (1010010010101101.1011101)2
to decimal, octal and hexa decimal 1.16 Write the output of the following code
equivalent separately void main( )
c) Find out the 1’s and 2’s complement of the {
binary number 101110010000. int x=1,y= -2,z=3,k;
d) Fill in the blanks k=x<y<z;
i) (FACE)16 = ( ? )2 = ( ? )8 printf(“%d”,k);
ii) (764)8 = ( ? )2 = ( ? )16 }
1.7 What is the purpose of a header file? Is the
use of a header file absolutely necessary? 1.17 Write the output of the following code
1.8 Differentiate between initialization and void main( )
assignment of a variable. {
1.9 Explain the working of pre and post increment int a=1,b= -2, c=3, d=0, k;
operators. k=a>b<c!=d>a==d<a;
1.10 Write a single statement in C to swap the printf(“%d”,k);
contents of two variables a and b. }
1.11 Write the correct statement to round off x, a
float, to an int value using type casting. 1.18 What will be output of the following c
1.12 List the different types of constants used in C. program?
Give two examples in each type. #include<stdio.h>
1.13 Write the output of following code : #include int main()
<stdio.h> {
int main() int a=10, b= - 20, c=0, k;
{ k=a||b&&c&&b||a&&b||c;
int c = 2 ^ 3 ; printf(“%d”,k);
printf(" %d\n" , c); return 0;
}
return 0;
} 1.19 What will be output of the following c
program?
1.14 What will be output of the following c
#include<stdio.h>
program?
int main()
#include<stdio.h>
{
int main()
KIIT/CS 1001: Programming in C (PC) Home Assignments Page 1
School of Computer Engineering, PROGRAMMING IN C
KIIT University, Bhubaneswar (Fundamentals, Operators & Expressions)

int a=0, b= -1, c=2, d=3, k; sl=sizeof(“111”);


k=a+b%c*d&&a!=b==c<d||a; sm=sizeof(111);
printf(“%d”,k); printf(“%d,%d,%d,%d,%d”,si.sj.sk,sl,sm);
return 0; return 0;
} }

1.20 What will be output of the following c 1.24 What would be the output ?
program? void main()
#include<stdio.h> {
int main() int x=10, y=17;
{ if(x>y)
int x=1,y=2; printf(“KIIT”);
y=++x; else if (x-y)
x=y++; printf(“KISS”);
y=x--; else
printf(“\n%d=%d”,x,y); printf(“KIMS”);
return 0; }
}
1.25 What will be output of the following c
1.21 What will be output of the following c program?
program? #include<stdio.h>
#include<stdio.h> int main()
int main() {
{ int x=1,y= -2;
int x=3,y=4,z=5; if(x=y);
x=y==z; {
printf(“%d”,x+y+z); x=x+y;
return 0; }
} printf(“%d”,x+y);
return 0;
1.22 What is the output of the following program }
segment?
int main() 1.26 What will be output of the following c
{ program?
int a; float b; char c; void main( )
printf(“%d,%d,%d”,sizeof(a), sizeof(b), {
sizeof(c)); int x=5;
return 0; if (1>x<8)
} printf ("WORLD');
else
1.23 What is the output of the following program printf ("UNIVERSE')
segment? return 0;
int main() }
{
int si,sj,sk,sl,sm; 1.27 What will be output of the following c
si= sizeof(1); program?
sj= sizeof(‘1’); int main()
sk= sizeof(“1”); {

KIIT/CS 1001: Programming in C (PC) Home Assignments Page 2


School of Computer Engineering, PROGRAMMING IN C
KIIT University, Bhubaneswar (Fundamentals, Operators & Expressions)

int x=0,y= 1, z=-2; 1.34 WAP swap the contents of two variables
if(x>y || y<z && z>x) without using a third variable.
printf(“CSIT”); 1.35 WAP to add two times in hour, minitue &
else second format entered through the keyboard
printf(“OTHERS”); in the format hh:mm:ss
return 0;
}

Fundamentals of C language/ Operators


& Expressions (LONG TYPE)

WAP stands for Write a program

1.28 Draw flow chart for the following


a) Draw a flow chart to find the sum of two
numbers entered by user.
b) Draw a flow chart to find out the largest
among three numbers a, b and c.
c) Draw a flow chart to find the roots of a
quadratic equation.
d) Draw a flow chart and write the algorithm
to print all natural numbers between 1 to n.
e) Draw a flow chart and write the algorithm
to find the factorial of a given number.
f) Draw a flow chart and write the algorithm
to find the GCD of two positive integer a
and b
g) Draw a flowchart to play a dice game
according to the following rules:
- If you throw two identical numbers,
you win.
- If the numbers are not the same, but
are both even, or both odd, you have
another turn.
- If one number is odd, and the other is
even, you lose.
1.29 WAP to convert temperature from centigrade
to Fahrenheit scale.
1.30 WAP to calculate perimeter of a circle.
1.31 WAP to calculate area of a triangle whose
three sides are given.
1.32 WAP to convert a quantity in meter entered
through keyboard into its equivalent kilometre
and meter as per the following format.
Example. 2430 meter = 2 Km and 430 meter.
1.33 WAP to find the average mark of 5 subjects of
a student and find the percentage. Assume full
mark of each subject is 100.
KIIT/CS 1001: Programming in C (PC) Home Assignments Page 3

You might also like