Sunday, 14 August 2016

15:05, Akshit Grover:

Comment Your Program Related Problems OR Question.
First Query Session.......
Waiting For Your Questions.
I Will Post The Solution On The Blog. :)

Saturday, 13 August 2016

23:21, Akshit Grover:


Algorithm For Greatest Among 5 Numbers Without Using Iterations....It Might Prove Helpful For Beginners To Understand The If-Else Statements.....




Output:



 




Friday, 12 August 2016

23:50, Akshit Grover:

Fibonacci Series Algorithm:

A Simple One but Still helps To Understand The Basic Functioning Of Statements In The Loop.


Output: 


23:07, Akshit Grover:

People Stay Wired, There's Much More To Come.
I Am Planning For A Query Session On This Sunday.

In The Session, You Can Comment Your Program Problem or The Question itself.
I Will Upload The Code for It As Soon As Possible. :) 



22:50, Akshit Grover:

Magic Square Algorithm:


Output:

Thursday, 11 August 2016

12:12 Akshit Grover,

Solution To First Problem:

Question:                                                                                                                                    
John Watson performs an operation called a right circular rotation on an array of integers, . After performing one right circular rotation operation, the array is transformed from  to .                                                  
Watson performs this operation  times. To test Sherlock's ability to identify the current element at a particular position in the rotated array, Watson asks  queries, where each query consists of a single integer for which you must print the element in the rotated array.  
Solution:                                                                                                                                     
#include <stdio.h>                                                                                                                      
void main()                                                                                                                                  
 {                                                                                                                                                  
    int a[50],i,c,n,k,q;                                                                                                                      
    input:                                                                                                                                       
    scanf("%d%d%d",&n,&k,&q);                                                                                                 
    if(q<=n)                                                                                                                                   
   {                                                                                                                                                
    for(i=0;i<=n-1;i++)                                                                                                                 
        {                                                                                                                                           
        scanf("%d",&a[i]);                                                                                                                 
        }                                                                                                                                           
    for(c=1;c<=k;c++)                                                                                                                   
        {                                                                                                                                           
        for(i=0;i<=n-2;i++)                                                                                                              
            {                                                                                                                                       
                a[0]=a[0]+a[i+1];                                                                                                         
                a[i+1]=a[0]-a[i+1];                                                                                                       
                a[0]=a[0]-a[i+1];                                                                                                          
            }                                                                                                                                       
       }                                                                                                                                            
    print("\n");                                                                                                                                
    for(i=0;i<=q-1;i++)                                                                                                                 
        {                                                                                                                                           
        printf("%d\n",a[i]);                                                                                                               
        }                                                                                                                                           
    }                                                                                                                                               
   else                                                                                                                                           
   goto input;                                                                                                                               
}                                                                                                                                                   
Output:                                                                                                                                        


23:46, Akshit Grover:

Just Read Two Program Problems On The Site www.hackerrank.com
Took Me 5 Minutes Just to understand The Problem.
I Wonder If I Can Solve Them.
Feeling Sleepy.
Gonna Solve Them Tomorrow.
Will Upload The Code Tomorrow By This Time.
It Will not Take Time To Solve, But To My Luck I have Classes Tomorrow, Moreover I Have To Report For NCC At 6 O'clock.
So Stay Wired yeah ;)