Twenty Twelve Theme pagination issue

You should not use query_posts at all. Everything is explained in this post I have recently done. Check out all the links as well that I’ve given in that post

The big problem why your pagination doesn’t work is that the default twenty twelve pagination function, twentytwelve_content_nav, doesn’t make provision for custom queries. You can, however, override this function, as it is wrapped in a if ( ! function_exists() ) conditional statement.

First, for your custom query. As said, don’t and never use query_posts, is most cases it fails outright on pagination. Here you going to use WP_Query. So change your page template to this (Just one point here, category_name uses the the category slug, not name)

<?php
/*
Template Name: C Programming Category page
*/

get_header(); ?>

    <div id="primary" class="site-content">
        <div id="content" role="main">

        <?php
        $args = array(
            'category_name' => 'c-programming'
        );

        $my_query = new WP_Query($args); ?>
        <?php if ( $my_query->have_posts() ) : ?>

            <?php /* Start the Loop */ ?>
            <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
                <?php get_template_part( 'content', 'custom' ); ?>
            <?php endwhile; ?>

            <?php twentytwelve_content_nav( 'nav-below' ); ?>

        <?php else : ?>

            <article id="post-0" class="post no-results not-found">

            <?php if ( current_user_can( 'edit_posts' ) ) :
                // Show a different message to a logged-in user who can add posts.
            ?>
                <header class="entry-header">
                    <h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
                </header>

                <div class="entry-content">
                    <p><?php printf( __( 'Ready to publish your first post? <a href="https://wordpress.stackexchange.com/questions/158371/%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
                </div><!-- .entry-content -->

            <?php else :
                // Show the default message to everyone else.
            ?>
                <header class="entry-header">
                    <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
                </header>

                <div class="entry-content">
                    <p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
                    <?php get_search_form(); ?>
                </div><!-- .entry-content -->
            <?php endif; // end current_user_can() check ?>

            </article><!-- #post-0 -->

        <?php endif; // end have_posts() check ?>
    <?php wp_reset_postdata(); ?>
        </div><!-- #content -->
    </div><!-- #primary -->

<?php get_sidebar( 'front' ); ?>
<?php get_footer(); ?>

Now, copy twentytwelve_content_nav function to your child theme functions.php. You are going to modify this. Here is the modified code. Work through it and check the changes, I’ve commented those

function twentytwelve_content_nav( $html_id ) {
    global $wp_query, $my_query; // add your custom query variable

    $html_id = esc_attr( $html_id );

    if ( $wp_query->max_num_pages > 1 ||  $my_query->max_num_pages > 1 ) : ?> // Add your custom query to the max_num_parameter
        <nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
            <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
            <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
            <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
        </nav><!-- #<?php echo $html_id; ?> .navigation -->
    <?php endif;
}

This should do it