Monday 15 June 2020

Break Statement C Language

Break (Loop,Switch Case)




A break keyword is used to forcefully stop a loop. For example, you have set a loop to run 100 times and your requirement got fulfilled after 10 iterations then the loop will run 90 times which leads wastage of time and resource. So the break statement is used to stop the loop when need got complete.

Example: Write a program to input and sum ten numbers. Input will stop immediately when a user-entered number is dividing by 11 then the loop must be stopped.

#include<stdio.h>
#include<conio.h>
/*##########################
     Girfa Student Help
     Break Statement Example
  ##########################*/

Single Link List

What is single link list


Link list is a dynamic data structure which occupies memory as required no memory wasted in contrast to Array. Data storage unit in list is called node as given below.


In link list node is created and dynamic space allocated while storing data. Next pointer point the next element of list you can add, delete data at any position of list. A start node points the first element of list.



One disadvantage of using arrays to store data is that arrays are static structures and therefore cannot be easily extended or reduced to fit the data set. Arrays are also expensive to maintain new insertions and deletions. In this chapter we consider another data structure called Linked Lists that addresses some of the limitations of arrays.




Sunday 14 June 2020

Swap variable value without using temporary variable

Q : Write a C program to swap the values of two variables without using the temporary variable?

Answer :

#include<stdio.h>
#include<conio.h>
/*##########################
     Girfa Student Help
     Swap two variable without
     temporary variable
  ##########################*/

Friday 12 June 2020

Count divisible number in given range C Language

Q : Write a C Program to print and count all numbers between 1 to 100 divisible by 11.


Answer : 



#include<stdio.h>
#include<conio.h>
/*##########################
     Girfa Student Help
     Count & print all number 1 to 100
     divisible by 11
  ##########################*/

Actual and former parameter C Language


As we know C language is building block of function. Anything done in C language by function. Function can take argument. There are two types of argument given below.

  • Argument pass while calling is actual
  • Argument while declaring function is former


#include<stdio.h>
#include<conio.h>
/*##########################
     Girfa Student Help
     Formal and actual parameter program
  ##########################*/
int sum(int,int);
void main()
{
     int a,b,c;
     clrscr();
     a=10;
     b=20;
     c=sum(a,b);   /* a and b are actual parameter */
     printf("\n\tA=%d\n\tB=%d\n\tSum=%d",a,b,c);
     getch();
}
int sum(n1,n2) /* n1,n2 are formal parameter */
{
     return n1+n2;
}

In the function main in the example above, a, and b are all actual parameters when used to call calculate sum function. On the other hand, the corresponding variables in sum_funcation definition (namely n1, n2) are all formal parameters because they appear in a function definition.



Difference between function definition and function declaration

Difference between  function definition and function declaration

DECLARATION
DEFINITION
A variable or a function can be declared any number of times
A variable or a function can be defined only once
Memory will not be allocated during declaration
Memory will be allocated
int f(int);
The above is a function declaration. This declaration is just for informing the compiler that a function named f with return type and argument as int will be used in the function.
int f(int a)
{
  return a;
}
The system allocates memory by seeing the above function definition.

Decimal to Binary conversion C language

Q : Write a C Program using function to print equivalent binary number of decimal number input by keyboard ?

Answer : 

#include<stdio.h>
#include<conio.h>
/*##########################
     Girfa Student Help
     Decimal to Binary conversion
  ##########################*/
void main()
{
     int d,b,ar[10],i;
     clrscr();
     printf("Enter number> ");
     scanf("%d",&d);
     i=0;
     while(d>0)
     {
          ar[i]=d%2;
          d=d/2;
          i++;
     }
     i--;
     while(i>=0)
     {
          printf("\t%d",ar[i]);
          i--;
     }
     getch();
}

Thursday 11 June 2020

Second Highest number from array using C language

Q : find second largest number from 1D array of n numbers.


Answer : 


#include<stdio.h>
void main()
{
     int n1,n2,ar[5],i;

Tuesday 9 June 2020

Answer :July 2019 Introduction to ICT Resources

Answer : NIELIT (O-Level) July 2019  Introduction to ICT Resources

1. Multiple Choice


1.1 : B
1.2 : A
1.3 : C
1.4 : D
1.5 : C
1.6 : A
1.7 : A
1.8 : B
1.9 : C
1.10 : C

Monday 8 June 2020

Solved : July 2019 Introduction to ICT Resources

Solved : NIELIT (O-Level) July 2019  Introduction to ICT Resources



1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer sheet supplied with the question paper, following instructions therein

1.1 : Number of links to connect n nodes in a mesh topology is __________.
(A) n(n+1)
(B) n(n−1)/2
(C) n+1
(D) n(n+1)/2
Answer

Answer : January 2019 Introduction to ICT Resources

Answer : NIELIT January 2019  Introduction to ICT Resources

1. Multiple Choice


1.1 : B
1.2 : D
1.3 : B
1.4 : D
1.5 : A
1.6 : C
1.7 : D
1.8 : A
1.9 : B
1.10 : D

Solved : January 2019 Introduction to ICT Resources

Solved : NIELIT January 2019  Introduction to ICT Resources 

1. Each question below gives a  multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10=10)

1.1 : ___________ is a device which is used to connect two different networks.
(A) Repeater
(B) Gateway
(C) Bridge
(D) None of the above
Answer

Sunday 7 June 2020

Answer : July 2018 Introduction to ICT Resources

Answer : NIELIT (O-Level)  July 2018   Introduction to ICT Resources 

1. Multiple Choice


1.1 : D
1.2 : A
1.3 : A
1.4 : A
1.5 : C
1.6 : C
1.7 : D
1.8 : C
1.9 : C
1.10 : B

Solved : July 2018 Introduction to ICT Resources

Solved : NIELIT (O-Level)  July 2018   Introduction to ICT Resources 

1.Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)

1.1 : Which of the following memories needs refresh?
A) SRAM B) DRAM
C) ROM D) All of above
Answer

Friday 5 June 2020

Answer : January 2018 Introduction to ICT Resources

Answer : NIELIT (O-Level) January 2018  Introduction to ICT Resources 

1. Multiple Choice


1.1 : C
1.2 : A
1.3 : A
1.4 : A
1.5 : D
1.6 : C
1.7 : B
1.8 : A
1.9 : A
1.10 : B

Solved : January 2018 Introduction to ICT Resources

Solved : NIELIT (O-Level) January 2018  Introduction to ICT Resources 

1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer  heet supplied with the question paper, following instructions therein. (1x10)

1.1 : The circuit used to store one bit of data is known as _____
A) Encoder B) Decoder
C) Flip-flop D) Register
Answer

Sunday 31 May 2020

Answer : July 2017 Introduction to ICT Resources

Answer : NIELIT (O-Level)  July 2017  Introduction to ICT Resources 

1. Muliple Choice


1.1 : A
1.2 : A
1.3 : C
1.4 : D
1.5 : A
1.6 : B
1.7 : C
1.8 : C
1.9 : C
1.10 : D

Solved July 2017 Introduction to ICT Resources

Solved : NIELIT (O-Level)  July 2017  Introduction to ICT Resources 

1. Each question below gives a multiple choice of answers. Choose the most appropriate one with the question paper, following instructions therein. (1x10)

1.1 : Which chip is used to store information that describes specific device parameters?
A) BIOS B) CMOS
C) ROM D) RAM
Answer

Solved : NIELIT (O-Level) January 2017 Introduction to ICT Resources

Answer : NIELIT (O-Level) January 2017 Introduction to ICT Resources

1. Multiple Choice


1.1 : C
1.2 : C
1.3 : B
1.4 : A
1.5 : B
1.6 : A
1.7 : C
1.8 : A
1.9 : A
1.10 : B

Friday 29 May 2020

Solved January 2017 Introduction to ICT Resources

Solved: NIELIT (O-Level) January 2017 Introduction to ICT Resources

1. Each question below gives a multiple choice of answers. Choose the most answer sheet supplied with the question paper, following instructions therein. 
(1x10)

1.1 : When a computer is first turned on or restarted, a special type of absolute loader called ____ is executed
A) Compile and Go loader
B) Boot loader
C) Bootstrap loader
D) Relating loader
Answer