Posts

Showing posts from December, 2013

C tutorial in HINDI

C tutorial in Hindi is basically designed for the beginner with the simple explanation of the concept which will help beginner to utilize the theoretical concept in a very convenient way. Pointer In C Array in C                                           Basics of C                                                             Control Structure                                                   Variable and Data Type Reference from :- youtube.com

String in c for Beginner

Image
The string in C programming language is actually a one-dimensional array of characters which is terminated by a  null  character '\0'. Thus a null-terminated string contains the characters that comprise the string followed by a  null . The following declaration and initialization create a string consisting of the word "Hello". To hold the null character at the end of the array, the size of the character array containing the string is one more than the number of characters in the word "Hello." char greeting [ 6 ] = { 'H' , 'e' , 'l' , 'l' , 'o' , '\0' }; If you follow the rule of array initialization then you can write the above statement as follows: char greeting [] = "Hello" ; Following is the memory presentation of above defined string in C/C++: Actually, you do not place the  null  character at the end of a string constant. The C compiler automatically places the '\0&#

Array in c part-2 for beginner

Sorting  #include<stdio.h> #include<conio.h> void main() { int a[5],j,i,temp; clrscr(); for(i=0;i<5;i++) scanf("%d",&a[i]); printf("\nassending order"); for(i=0;i<5;i++) { for(j=i+1;j<5;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } printf("\n%d",a[i]); } getch(); } Sorting descending #include<stdio.h> #include<conio.h> void main() { int a[5],i,j,temp; clrscr(); for(i=0;i<5;i++) scanf("%d",&a[i]); printf("\ndescending order"); for(i=0;i<5;i++) { for(j=i+1;j<5;j++) { if(a[i]<a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } printf("\n%d",a[i]); } getch(); } Reversal Of element in array #include<stdio.h> #include<conio.h> void main() {

Array in c for beginner

Image
C programming language provides a data structure called  the array , which can store a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type. Instead of declaring individual variables, such as number0, number1, ..., and number99, you declare one array variable such as numbers and use numbers[0], numbers[1], and ..., numbers[99] to represent individual variables. A specific element in an array is accessed by an index. All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element. Declaring Arrays To declare an array in C, a programmer specifies the type of the elements and the number of elements required by an array as follows: type arrayName [ arraySize ]; This is called a  single-dimensional  array. The  arraySize  must be an integer c

Argusoft 2nd round programming questions with solution

Image
Argusoft 2nd round programming questions with solution program 2- write a program to input some number and check whether it belongs to series-1 or not. series 1 :- 4,2,5,20,40,200,4000,160000,32000000 Solution #include<stdio.h> #define N 9 int input[N]; void main() {                 int i,j,k,l;                 printf(" Predefined series is 4,2,5,20,40,200,4000..... \n");                 printf("Enter number Minimum 9 numbers of the series to check\n");                 for(i=0;i<N;i++)                 {                                 scanf("%d",&input[i]);                 }                //series goes like this 1*3=4                //2*4=5                //3*5=6                 int check;                 j=0;                 k=2;                 l=3;                 for(i=0;i<N;i++)                 {                                  if(input[j++]*input[k++]==input[l++])         

Argusoft 2nd round programming questions with solution

Image
Argusoft 2 nd round programming questions with solution Program 1 :- Write a program where different number if taken as input as put them in an order like the largest element will get place in middle ,the second largest will get place  in right of middle and third largest will get place in left of middle and so on for entire number of inputted items. Sample Input :-   12,4,3,5,6,19,15,9,8 Output :- 3,5,8,12,19,15,9,6,4 SOLUTION #include<stdio.h> #define max 9 // Maximum number of items int a[max]={12,4,3,5,6,19,15,9,8}; //explicit initialization of array int res[max]; //This array will store the final result void main() {                 int i,j,mid,large_left,large_right,temp; // large_left for third largest //large_right for second largest //mid is for middle which if largest one //sort                 for(i=0;i<max;i++)                 printf("%d\t",a[i]);                 for(i=0;i<max;i++)                 {   

GK 50 Questions with Answer

Image
No Questions Quiz 1 Answers 1 Carl and the Passions changed band name to what Beach Boys 2 How many rings on the Olympic flag Five 3 What colour is vermilion a shade of Red 4 King Zog ruled which country Albania 5 What colour is Spock's blood Green 6 Where in your body is your patella Knee ( it's the kneecap ) 7 Where can you find London bridge today USA ( Arizona ) 8 What spirit is mixed with ginger beer in a Moscow mule Vodka 9 Who was the first man in space Yuri Gagarin 10 What would you do with a Yashmak Wear it - it's an Arab veil 11 Who betrayed Jesus to the Romans Judas Escariot 12 Which animal lays eggs