You are on page 1of 2

1. What are LR Values ( Lvalue and Rvalue )?

2. Find the area of a circle ( use constant)


3. Identify the keywords, identifiers and also identify illegal ones
Enum short registertypedefcase for do sum _SUM
SUM AVG5 while printf sqrt long void 8sum _sum
_sum_of_n _sum_ #num

4. identify the numbers and tell the type of values and also check whether it is valid or
not
5280 320U 1456L 0x23 0X23 12,200 25-6
01 0783 0x12FF 23,25.67 54. .54 3e5
3e-2 ‘A’ ‘a’ “A” “a” “5+2” “#”
5. display the following strings using printf
a) It’s Raining!
b) To, continue, press the “RETURN” key
6. Print any 5 words in a separate line using single printf function
7. Display the following text using printf as below
--------------------------
SNo Name Marks
------- ------------------
1 Namratha 914
2 Lakshmi 878
--------------------------
8. Print your name vertically
9. Find the length of your name using printf
10. Which of the following is not a valid declaration in C?
short int x;
signed short x;
short x;
unsigned short x;
11. What is the output
#include<stdio.h>
int main()
{
unsigned int x = -1;
int y = ~0;
if (x == y)
printf("same");
else
printf("not same");
return 0;
}
12. For example variable x has value 347.5236
Print value of x with only 2 decimals i.e 347.52

13. What is the difference between const and #define


14. Difference between getch() and getche()
15. Difference between gets() and scanf() to read string
16. Difference between %d and %i in
17. What is the output
#include <stdio.h>
int main()
{
void num=10;
printf("%d", num);
return 0;
}

18. Write the output


#include <stdio.h>
int main()
{
char a = 65;
printf("%u", a);
printf("%d", a);
printf("%i", a);
printf("%c", a);
return 0;
}
19. What is the output of expressions created with relational and logical operators
20. What is the output for the following
a) 5>6 && 6>5
b) !(4!=4) && (5==5)
c) !(4!=4 && 5==5)
d) 4+3 > 6
e) 16>(1+4/3*3)
21. suppose i=8 , j=5 find the final value
a. (3*i – 2* j)
b. 2*((i/5)+(4*(j-3))%(i+j-2)
22. What is the output and explain how it comes
int a=1, b=2;
b=++a;
a=b++
c=a+b;
printf(“%d”,c);

23. Write C programs


a) Swap values in two variables using temporary variable
b) Swap values in two variables without using temporary variable
c) Swap values in two variables using XOR (^) operator
d) Convert any character from lowercase to capital letter and vice versa
e) Biggest number among any 2 numbers
f) Convert temperature from Celsius to Fahrenheit
g) Find whether a year is leap year or not
h) find maximum and minimum of two numbers without using loop and any
condition.
i) program to print sum of two integers without +
j) divide a number by 4 without using '
k) find roots of a quadratic equation

You might also like