ITP - Assignment 2

advertisement
INTRODUCTION TO PROGRAMMING
ASSIGNMENT # 02
Q1. What do we mean by formatted console I/O functions and unformatted
console I/O functions?
Q2. Explain the following in brief:







putchar() and getchar().
continue and break statements.
scanf and printf.
assignment operators
storage classes in ‘C’.
I/O statements in ‘C’.
‘= ‘ and ‘= =’ operators in C.
Q3. Write macro definition for obtaining the bigger of two numbers?
Q4. What happens if an array is initializing values is greater than the dimension
specified for an array?
Q5. Write a program to arrange n integer numbers in decreasing order by using
arrays?
Q6. Write a program of Fibonacci series using arrays?
Q7. What happens if number of initializing values is greater than the dimension
specified for an array?
Q8. Write the output of following code:

#include<stdio.h>
main()
{
static int a[10],i;
for(i=0;i<10;i++)
print(“\n %d”,i[a]);
}

main ()
{
int a = 300, b, c ;
if ( a >= 400 )
b = 300 ;
c = 200 ;
printf ( "\n%d %d", b, c ) ;
}

#include<stdio.h>
main( )
{
int p = 8, q = 20 ;
if ( p == 5 && q > 5 )
printf ( "\nwhy not c" ) ;
else
printf ( "\ndefinitely c !" ) ;
}

main( )
{
int i = 1, j = 1 ;
for ( ; ; )
{
if ( i > 5 )
break ;
else
j += i ;
printf ( "\n%d", j ) ;
i += j ;
}
}
----------------------------------------------------------------------------------------------------------
Download