Chandigarh University Submitted by

Chandigarh University

Submitted by : Vishal Srivastav
(18BCS1199)
CSE 3 GROUP A

Submitted to : PROF. BALJINDER

COMPUTER ASSIGNMENT
Pick the date

?

.

Q.1- W.A.P to find reverse of a number.
Sol-
#include
int main()
{
int rev=0,r,n;
printf(“enter a number”);
scanf(“%d”,&n);
do
{
r=n%10;
rev=(rev*10)+r;
n=n/10;
}while(n>0);
printf(“reverse is %d”,rev);
return 0;
}
OUTPUT-

Q.2- W.A.P to generate following output
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
Sol-
#include
int main()
{
int r=5,c=5,i,j;
for(i=1;i