0% found this document useful (0 votes)
8 views8 pages

Question Bank CP

The document is a question bank from the Dr. Rajendra Gode Institute of Technology covering various topics in C programming. It includes definitions, explanations, programming tasks, and questions related to data types, operators, control structures, arrays, pointers, strings, functions, and file handling. The questions are designed to assess understanding and application of C programming concepts.

Uploaded by

rautshreyash34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views8 pages

Question Bank CP

The document is a question bank from the Dr. Rajendra Gode Institute of Technology covering various topics in C programming. It includes definitions, explanations, programming tasks, and questions related to data types, operators, control structures, arrays, pointers, strings, functions, and file handling. The questions are designed to assess understanding and application of C programming concepts.

Uploaded by

rautshreyash34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Dr.

RAJENDRA GODE INSTITUTE OF TECHNOLOGY


RESEARCH, AMRAVATI
DEPARTMENT OF APPLIED SCIENCE & HUNAMITIES
Question Bank

Q.1 Define terms-

1. Variables

2. Keywords

3. Compiler

Q.2 Explain the basic structure of C program with example.

Q.3 Explain C Token.

Q.4 Explain different types of operators in C.

Q.5 Explain in-built functions.

Q.6 Explain data types in C.

Q.7 Give the rules of naming identifiers.

Q.8 Give the short notes on precedence of operators with example.

Q.9 Write a program to print ASCII value of characters using format specifiers.

Q.10 Write a C program to calculate and print the area and perimeter of rectangle.

Q.11 Write a program to read the radius of circle and print area of circle.

Q.12 What is the output of following program, if user input value is 8888, 888, 88.

#include <stdio.h>

main()

int a, b, c;

scanf(“%1d%2d%3d”,&a, &b, &c);

printf(“sum=%d”,a + b + c);

Q.13 What will be the output of following code.

#define CUBE (x)(x + x + x)


main()

printf(“Cube=%d”,CUBE(4 + 5));

Q.14 Explain in details various functions for reading and writing of characters.

Q.15 What will be the output of following.

#include <stdio.h>

main()

int a=9, b=12, c=3;

float x, y, z;

x= a - b / 3 + c * 2 - 1;

y = a – b / (3 + c) * (2 - 1);

z = a – (b / (3 + c) * 2) – 1;

printf(“x = %f”, x);

printf(“y = %f”, y);

printf(“z = %f”, z);

Q.16 Differentiate between while and do –while statements.

Q.17 What is the output of following.

#include <stdio.h>

main()

int c=1, s=0, n;

n=30;

for(; c<=n;c=c+2)

{
s + c;

c++;

printf(“\nsum=%d”,s);

Q.18 Write a program to print sum of square of first 20 odd no by using-

1. for loop 2. while loop 3. do-while loop

Q.19 Explain the following statements with example-

1. break 2.continue 3.goto 4.return

Q.20 Explain relational operators with examples.

Q.21 Explain simple if, if-else statements with examples.

Q.22 Write a c program to print the sum of n numbers (1 to n).

Q.23 Explain while and do-while loop with examples.

Q.24 Write a c program to print following structure using ‘nested for loop’-

*****

****

***

**

Q.25 Explain string handling functions with examples.

Q.26 Write a c program using while, do-while, and for loop to add sum of odd and even
numbers.

Q.27 Explain break and continue statements by using examples.

Q.28 Write a program to print following structure using for loop.

****

****

****
****

Q.29 Write a program to find largest number among three numbers and draw its flow chart.

Q.30 Write a program to find addition of first ten odd numbers.

Q.31 Find the following output-

main()

int num = 2;

num+ = 8;

printf(“num=%d”,num);

num- = 3;

printf(“num=%d”,num);

num*=2;

printf(“num=%d”,num);

num/=2;

printf(“num=%d”,num);

Q.32 Find the output-

void main()

int ch;

ch=getchar();

putchar(++ch);

ch++;

putchar(ch++);

printf(“\n”);

putchar(ch);

--ch;
putchar(ch--);

putchar(ch);

Q.33 What is mean by Array? Explain single dimensional array with its advantages and
example.

Q.34Write a program to find largest and smallest number in an array of ten integer numbers.

Q.35 Explain multi-dimensional array with example.

Q.36 Explain two-dimensional array with example.

Q.37 Explain array with its declaration and initialization techniques.

Q.38 Write a program in C to read n number of values in an array and display them in reverse
order.

Q.39 Write a program in C to find the sum of all elements in an array.

Q.40 Write a program in C for 2D array of size 3*3 and print the matrix.

Q.41 List and explain different string handling function with suitable

example.

Q.42 Explain in details various functions for reading and writing of

characters.

Q.43 Explain arithmetic operations on character with one example.

Q.44 Explain strlen() and strcpy() function with their syntax and example.

Q.45 Explain strlcmp() and strcat() function with their syntax and

example.

Q.46 Explain strchr() and strstr() function with their syntax and example.

Q.47 Write a C program to count the character ‘a’ that appears in the

string “aabbaa” for number of times.

Q.48 Write a C program to reverse a sentence using recursion.

Q.49 Write a C program to sort a string in lexicographical or dictionary

order.

Q.50 Write a C program to convert all characters of string from


lowercase to uppercase without using standard function.

Q.51 What is function in C with its declaration and definition.

Q.52 Explain call by value mechanism with example.

Q.53 Explain call by reference with example.

Q.54 Explain indirection (*) operator and address (&) operator with suitable example.

Q.55 Explain pointers along with its uses.

Q.56 What is pointer? What kind of information does the pointer variable represent? Explain
different uses of pointer.

Q.57 Explain pointer with its types and their syntax.

Q.58 Explain pointer arithmetic with suitable example.

Q.59 Explain pointer to pointer with example.

Q.60 Explain pointer to function with example.

Q.61 Differentiate between array of pointer and pointer to array.

Q.62 Differentiate between actual parameter and formal parameter.

Q.63 Write a C program to design a function sum which calculate addition of two integer
numbers.

Q.64 Write a C program to find the length of string using pointer.

Q.65 What is the value of a and b after following statement executed.

int *p1, *p2, a, b;

p1=&a;

p2=&b;

*p1=15;

*p2=35;

*p2=(*p1)++….;

Q.66 Find and justify the output of following program.

#include<stdio.h>

int change(int *);

void main()
{

int x=100;

change(&x);

printf(“x=%d”,x);

int change(int *y)

*y=*y+200;

Q.67 Find and justify the output of following program.

#include<stdio.h>

Main()

int i, j, *ptr;

I=10;

ptr=&i;

j=*ptr;

*ptr=20;

printf(“The value of i=%d\n”,i);

printf(“The value of j=%d\n”,j);

Q.68 Find the output of following program.

#include<stdio.h>

main()

char text[]=”Welcome”;

int num[]={10,20,30,40,50,60,70,};
int i;

for(i=0; i<7; i++)

printf(“Element no. %d , value=%c\n”,i+1,*(text + i));

printf(“Element no. %d , value=%d\n”,i+1,*(num + i));

Q.69 Explain the meaning of following declarations.

i. int *px;
ii. int *p[10];
iii. int func(int *num[])
iv. int p(char *a);
v. int (*p(char *a))[10];

Q.70 Write a program to copy a file into another file using fputs() and fgets() functions.

Q.71 Explain the difference between declaration and definition of structure.

Q.72 Write typedef and struct declaration for students in college.

Q.73 Explain the difference between structure and an array.

Q.74 What is command line argument? Explain it with example.

Q.75 What is union? Differentiate the difference between structure and union.

Q.76 Explain the structure with example.

Q.77 List and explain file handling functions.

Q.78 Write a C program to design a function factorial which calculate factorial of N number.

Q.79 Explain following functions in brief with syntax.

i.fscanf() ii.fseek() iii.fread() iv.fwrite()


v.fprintf() vi.fopen() vii.fclose() viii.fgets()
ix.fputs() x.fgetc() xi.fputc()

You might also like