Monday, 11 April 2016

Pre GTU Questions - CPU




        

What is flow chart? Draw flow chart to find factorial number.                                     
Explain block diagram of Computer.                                                                               
What is algorithm? Write algorithm to find largest number between 3 numbers.  
Explain Different Data types used in C.
Explain all types of if statement with example.
Explain associativity & precedence of operator.                                                            
Explain type conversion & type casting.                                                                          
Explain various loop available in C.                                                                                 
Explain software & hardware with example.                                                                  
Explain malloc & calloc with example.                                                                           
Explain call by value & call by reference with example.                                                
What is pointer? Explain with example.                                                                          
Explain one dimensional array with example.                                                                
Explain all operators with example.                                                                                
Explain goto statement with example.                                                                            
Explain switch case with example.                                                                                  
Explain different file management function with example.                                           
Explain structure with example.                                                                                      
Explain call by value & call by reference with example.                                                
Explain all string function with example.                                                
What is keyword & identifier?
Give syntax and Example of UDF’s elements.                                                                 
Explain recursive function with example.                                                                       
Explain different categories of UDF with example.                                                        
Write a program to generate Fibonacci series.                                                              
Write a program to generate following pattern.                                                            
What is file management? Explain fopen() with all its mode.                            
Difference between structure & union                                                               
Explain break & continue statement with example.                                                       
Explain pointer to pointer with example.                                                                        
What is string? How to initialize (get value of string) and print the string?     
Write a program to find maximum number between 3 numbers.
Write a program to find multiplication of two matrixes.
Write to program to find sum of first n odd numbers.
Write a program to reverse the input string.
Write a program to swap the value using call by references.
Write a program to concatenate two strings.
Write a program to check number is prime or not.
Write a program to find addition, subtraction, division & multiplication using switch case.
Write a program to check string is palindrome or not.
Create a structure with name student.
Members: student name, roll no, marks of 3 subjects.
Write a program to find the length of string.
                          



Tuesday, 22 March 2016

MCQ - CPU


1) Who is father of C Language?




D.  E. F. Codde

2) C Language developed at _________?




D. Cambridge University in 1972

3) Output of follwing code 
  #include <stdio.h>
  void main() 
  {
             int x = 5;  
             if (x < 1); 
                 printf("Hello");
}

4) Output of following code

#include <stdio.h>
        void main()
        {
            double ch;
            printf("enter a value btw 1 to 2:");
            scanf("%lf", &ch);
            switch (ch)
            {
            case 1:
                printf("1");
                break;
            case 2:
                printf("2");
                break;
            }
        }


5) Output of following code

    #include <stdio.h>
    void main()
   {
            int ch;
            printf("enter a value btw 1 to 2:");
            scanf("%d", &ch);
            switch (ch, ch + 1)
            {
            case 1:
               printf("1\n");
                break;
            case 2:
                printf("2");
                break;
            }
        }


6) Which of the following operator takes only integer operands?
A. +
B. *
C. /
D. %
E. None of these


7)  Output:
void main()
{
    int i=0, j=1, k=2,m;
    m = i++|| j++ || k++;
    printf("%d %d %d %d",m,i,j,k);


8) Output:
void main()
{
      int i=10;
      i = !i>14;
      printf("i=%d", i);
}
 
9) Output:
void main()
{
      int a, b, c, d;
      a = 3;
      b = 5;
      c = a, b;
      d = (a, b);
      printf("c=%d d=%d", c, d);
}
10) Output:
void main()
{
    int z, x=5, y= -10, a=4, b=2;
    z = x++ - --y*b/a;
    printf("%d",z);
}
 



Monday, 7 March 2016

Programming Definition - CPU


1) Write a  program to display following pattern (Rectangle, arrow, rectange).
2) Write a program to display the following pattern.
x=a/b-c;
3) Write a program to convert fahrenheit to celsius and celsius to fahrenheit.
F=9C/5 + 32;
4) Write a program to display the equation of line in a form of : ax + by = c
value of a, b and c is taken from user
5) Write a program to take the input in form of rupees and paise and convert it into paise
(15.29 -= 1529 paise)
6) The price of one kg of rice is 15.25 and one kg of sugar is 20. Get the number of KG from user and display the value in following form
****List of Itemes***** 
Item                         Price
Rice                         15.25
Sugar                       20
Total                        25.25
7) Write a program to Swapping of two numbers
8) Write a program to find the simple interest
9) Write a program to read 5 subjects marks and display the percentage
10) Write a program to calculate the gross salary of employee.
11) Write a program to check number is odd or even
12) Write a program to check number is postive, negative or zero
13) Write a program to find greater number from two numbers
14) Write a program to find greater number from three numbers
15) Write a program to find Electricity bill
16) Write a program to swap the value of  two variables without using third.
17) Write a program to check year is leap year or not.
18) Write a program to find maximum number between two numbers using ternary operator
19) Write a program to perform division using shift right
20) Write a program to perform multiplication using shift left
21) Write a program to print ASCII value of a character
22) Write a program to convert lower case letter into upper case
23) Write a program to check person is eligible for vote or not
24) Write a program to display the examination result
if avg is above 80 then distinction
if avg is less than 80 and greater than 70 then first class
if avg is less than 70 and greater than 60 then second class
if avg is less than 60 and greater than 50 then pass class
if avg is less than 50 then fail
25) Write a program to display the total amount after purchasing the clothes with consideration of following details
if cloth is from mill then discount is 0%, 5%, 10% and 15% if amount is between 0-100,100-200,200-300 and above 300
if cloth is from handloom then discount is 5%,10%,15% and 20%
26) Write a program that will read the value of x and evaluate the following function
y = 4x + 100 for x<40
y=300 for x=40
y=4.5x + 150 for x<40
27) Write a program to check candidate is eligible for admission or not based on following condition
marks in maths >=60
marks in phy>= 50
marks in chem>=40
total in all 3 >=200
or total in maths & phy >=150
28) Write a program to read the value of 4 variables a,b,c and d and find the ratio of (a-b)/(c-d) and print result only if c-d is not equal to zero
29)Write a program to check employee is eligible for loan or not.En employee can apply for a loan at the beginning of every six months but he will be get the amount according to the following company rule
1) cannot get more than two loan
2) maximum permissible total loan is limited to 50000
3 loan amount need to give
if loan1 is zero then check the loan2 and loan 3 not more than 50000
if loan1 is zero check loan 2 is zero if loan 2 is not zero then check total of loan 2 and loan3 is greater than max than eligible amount is max - total
30) Write a program to print first 10 numbers
31) Write a program to print sum of first 10 numbers
32) Write a program to print 20 horizontal asterisks(*)
33) Write a program to print the sum of numbers from m to n
34) Write a program to print largest number from six number using ternery operator
35) Write a program to count total number of positive, negative and zero until -1 is entered,
36) Write a program to print day using switch case.
37) Write a program to create calculator using switch case.