You are on page 1of 3

C TRAINING

WEEKLY ASSESSEMENT
Timing : 1 hr
Note : Write it on Note !!

A. Write a program to perform basic arithmetic operations


B. Write a program to perform relational operations
C. Write a program to print a%b in output console
D. Write a program to find a ascii value of character
E. Write a program to find a leap year
F. Write a program to perform addition, subtraction, multiplication,
division and exit
G. Write a C program to find positive and negative elements in array
H. Write a C program to rotate elements in an array left and right
I. Write a C program to insert,delete,display a element in array
J. Write a C program to get elements for 2D array
K. Write a C program to merge two arrays of same size

Find the output for below program

1. Sample program
#include<stdio.h>

int main()
{
printf("%x\n", -1>>1);
return 0;
}

2.Find the output of the program


#include<stdio.h>
int main()
{
unsigned int m = 32;
printf("%x\n", ~m);
return 0;
}

3.Write the output of this program

#include<stdio.h>

int main()
{
unsigned char i = 0x80;
printf("%d\n", i<<1);
return 0;
}

4.Write the output of this program

#include<stdio.h>
enum week{sun,mon,tues,wed,thur,fri,sat};
int main()
{
enum week day;
day=wed;

printf("%d",day);
}

5.Write the output of this program


#include<stdio.h>

int main()
{

enum days {MON=-1, TUE, WED=6, THU, FRI, SAT};


printf("%d, %d, %d, %d, %d, %d\n", ++MON, TUE, WED, THU, FRI,
SAT);
return 0;
}

You might also like