AR 23-I-I IP (Unit 1 & 2) Rivision
AR 23-I-I IP (Unit 1 & 2) Rivision
14 Which for loop has range of similar indexes of ‘i’ Analyzing (L4) CO2 2M
used in for (i = 0;i < n; i++)
1) for (i = n; i>0; i–)
2) for (i = n; i >= 0; i–)
3) for (i = n-1; i>0; i–)
4) for (i = n-1; i>-1; i–)
15 What will be the output of the following C code? Analyzing (L4) CO2 2M
#include<stdio.h>
main()
{
if(0)
{
printf(“\n First statement”);
}
if(-10)
{
printf(“\n Second statement”);
}
if(80-10*8)
{
printf(“\n Third statement”);
}
}
16 What is the output of the given below program? Analyzing (L4) CO2 2M
#include<stdio.h>
int main()
{
int i;
for (i=0; i<3; i++)
{
printf("%d", i);
}
return 0;
}
17 Predict the output, Analyzing (L4) CO2 2M
#include <stdio.h>
int main()
{
int x = 1;
switch (x)
{
case 1: printf("Choice is 1 \n");
default: printf("Choice other than 1 \n");
}
return 0;
}
18 How many times “Hello” will be printed when the Analyzing (L4) CO2 2M
following code is executed?
#include<stdio.h>
int main()
{
int i=6;
while(--i>0)
printf("Hello\t");
return 0;
}
19 Write the output for below code, Analyzing (L4) CO2 2M
#include <stdio.h>
int main ()
{
int a = 10;
do {
printf("%d ", a++);
++a;
}while( a >= 20 );
printf("%d ", a);
return 0;
}
27 Build a program to find the sum of the series up to Applying (L3) CO2 5M
n terms where n is an integer entered by the user.
1+2+4+7+11+16+....
28 Build a program to find out the value of x raised Applying (L3) CO2 5M
to the power y, where x and yare positive integers
without using pow() function.
29 Build a program to find largest number from Applying (L3) CO2 5M
three given numbers
30 Build a program to find whether given year is leap Applying (L3) CO2 5M
or not
31 Build a program to print the sum of digits of any Applying (L3) CO2 5M
number
32 Build a program to accept a number and find the Applying (L3) CO2 5M
reverse of that number.
33 Build a program to accept any number n and print Applying (L3) CO2 5M
the sum of square of all numbers from 1 to n.
34 Build a program to accept any number n and print Applying (L3) CO2 5M
the cube of all numbers from 1 to n which are
divisible by 3
35 Build a program to accept any six digit number Applying (L3) CO2 5M
and print the sum of all even digits of that number
and multiplication of all odd digits