Tuesday 6 December 2016

C Language Fundamental Assignment


C Language
Fundamental Assignment
Q1. Write a program to display the following pattern
**********************************************************
                Name                    Your Name
                Subject                 Subject Name
                Course                  Course Name
**********************************************************

Thursday 1 December 2016

C Language practice Question

C language (Set1)

Test

TOTAL TIME: 1 HOURS                                                                                                  TOTAL MARKS: 50
 


1. Which of the following is not a valid variable name declaration?
a) int __a3;
b) int __3a;
c) int __A3;
d) None of the mentioned
2. The format identifier ‘%i’ is also used for _____ data type?
a) char
b) int
c) float
d) double

Saturday 26 November 2016

Nested Structure

Nested Structure C Language

As you know though structure we can process data record by record that is why structure is called user defined data type. In some specific case you nested structure where a structure is inside of a structure. For example when process a student record with their dob. Take a look on following example.
#include<stdio.h>
#include<conio.h>
#include<string.h>
typedef struct s
{
    int roll;
    char name[10];
    struct d
    {
         int dd,mm,yy;
    }dob;
}student;

Wednesday 23 November 2016

Static Variable

Static Variable

A static variable initialize by 0 instead of garbage at the time of declaration. Static variable retain its value in memory till the program is running.

On the other hand auto variable lost its data when function scope pass out . But static variable retain its value whenever  scope get over.

You can trace that how many times a function is being called.

void test()
{
    static int k; /* k will retain its value when function scope goes down */
    printf("\nThis function being called %d times ",++k);
}