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

Set-1 PC Fundamentals Home Assignment

This document contains questions about fundamentals of the C programming language including operators, expressions, data types, and basic programs. There are 34 questions covering topics such as differences between data types, operator precedence, input/output, conditional statements, loops, functions, and algorithms. Students are asked to write programs to perform tasks like temperature conversion, calculating geometric shapes, and averaging test scores. They are also asked to draw flowcharts for algorithms to find sums, maximums, factorials and other sequential processes.

Uploaded by

Ian Akash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views

Set-1 PC Fundamentals Home Assignment

This document contains questions about fundamentals of the C programming language including operators, expressions, data types, and basic programs. There are 34 questions covering topics such as differences between data types, operator precedence, input/output, conditional statements, loops, functions, and algorithms. Students are asked to write programs to perform tasks like temperature conversion, calculating geometric shapes, and averaging test scores. They are also asked to draw flowcharts for algorithms to find sums, maximums, factorials and other sequential processes.

Uploaded by

Ian Akash
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

School of Computer Engineering,

KIIT University, Bhubaneswar

PROGRAMMING IN C
(Fundamentals, Operators & Expressions)

Fundamentals of C language/ Operators


& Expressions
(SHORT TYPE)
1.1 Find out Differentiate between primary
memory and secondary memory.
1.2 What is the difference between RAM and
ROM?
1.3 Write the difference between high level
language and assembly language.
1.4 Write any two advantages of compiler over
interpreter.
1.5 What is the difference between linker and loader.
1.6 Do as directed.
a) Convert (342.56)10 to it's binary, octal and
hexadecimal equivalent separately.
b) Convert (1010010010101101.1011101)2
to
decimal, octal and hexa decimal
equivalent separately
c) Find out the 1s and 2s complement of the
binary number 101110010000.
d) Fill in the blanks
i)
ii)

(FACE)16 = ( ? )2 = ( ? )8
(764)8 = ( ? )2 = ( ? )16

1.7 What is the purpose of a header file? Is the


use of a header file absolutely necessary?
1.8 Differentiate between initialization and
assignment of a variable.
1.9 Explain the working of pre and post increment
operators.
1.10 Write a single statement in C to swap the
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.12 List the different types of constants used in C.
Give two examples in each type.
1.13 Write the output of following code : #include
<stdio.h>
int main()
{
int c = 2 ^ 3 ;
printf(" %d\n" , c);
return 0;
}
1.14 What will be output of the following c
program?
#include<stdio.h>
int main()
KIIT/CS 1001: Programming in C (PC) Home Assignments

{
int a=3, b= -4;
printf ("%d", a%b+a*b%a);
return 0;
}
1.15 What will be output of the following c
program?
#include<stdio.h>
int main()
{
int a=3, b= -4;
printf ("%d", a*b-a%b/a);
return 0;
}
1.16 Write the output of the following code
void main( )
{
int x=1,y= -2,z=3,k;
k=x<y<z;
printf(%d,k);
}
1.17 Write the output of the following code
void main( )
{
int a=1,b= -2, c=3, d=0, k;
k=a>b<c!=d>a==d<a;
printf(%d,k);
}
1.18 What will be output of the following c
program?
#include<stdio.h>
int main()
{
int a=10, b= - 20, c=0, k;
k=a||b&&c&&b||a&&b||c;
printf(%d,k);
return 0;
}
1.19 What will be output of the following c
program?
#include<stdio.h>
int main()
{
Page 1

School of Computer Engineering,


KIIT University, Bhubaneswar

PROGRAMMING IN C
(Fundamentals, Operators & Expressions)
sl=sizeof(111);
sm=sizeof(111);
printf(%d,%d,%d,%d,%d,si.sj.sk,sl,sm);
return 0;

int a=0, b= -1, c=2, d=3, k;


k=a+b%c*d&&a!=b==c<d||a;
printf(%d,k);
return 0;
}
1.20 What will be output of the following c
program?
#include<stdio.h>
int main()
{
int x=1,y=2;
y=++x;
x=y++;
y=x--;
printf(\n%d=%d,x,y);
return 0;
}
1.21 What will be output of the following c
program?
#include<stdio.h>
int main()
{
int x=3,y=4,z=5;
x=y==z;
printf(%d,x+y+z);
return 0;
}
1.22 What is the output of the following program
segment?
int main()
{
int a; float b; char c;
printf(%d,%d,%d,sizeof(a), sizeof(b),
sizeof(c));
return 0;
}
1.23 What is the output of the following program
segment?
int main()
{
int si,sj,sk,sl,sm;
si= sizeof(1);
sj= sizeof(1);
sk= sizeof(1);
KIIT/CS 1001: Programming in C (PC) Home Assignments

}
1.24 What would be the output ?
void main()
{
int x=10, y=17;
if(x>y)
printf(KIIT);
else if (x-y)
printf(KISS);
else
printf(KIMS);
}
1.25 What will be output of the following c
program?
#include<stdio.h>
int main()
{
int x=1,y= -2;
if(x=y);
{
x=x+y;
}
printf(%d,x+y);
return 0;
}
1.26 What will be output of the following c
program?
void main( )
{
int x=5;
if (1>x<8)
printf ("WORLD');
else
printf ("UNIVERSE')
return 0;
}
1.27 What will be output of the following c
program?
int main()
{
Page 2

School of Computer Engineering,


KIIT University, Bhubaneswar

PROGRAMMING IN C
(Fundamentals, Operators & Expressions)

int x=0,y= 1, z=-2;


if(x>y || y<z && z>x)
printf(CSIT);
else
printf(OTHERS);
return 0;

1.34 WAP swap the contents of two variables


without using a third variable.
1.35 WAP to add two times in hour, minitue &
second format entered through the keyboard
in the format hh:mm:ss

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