Sameer Sir Classes, Jabalpur Auth Exam Center Oracle, Microsoft 9407077858
Sameer Sir Classes, Jabalpur Auth Exam Center Oracle, Microsoft 9407077858
trace :-
i = 1 j = 1 to 3
j = 1 ---> 1 1
j = 2 ---> 1 2
j = 3 ---> 1 3
-----------------------------
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
i=2 j = 1 to 3
j = 1 ---> 2 1
j = 2 ---> 2 2
j = 3 ---> 2 3
------------------------------------------------------------------------
n=3
i=1 1
i=2 1 2
i=3 1 2 3
for( i = 1 ;i < = n; i++)
{
------------------------------------------------------------------------
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
WAP TO PRINT TRIAGLE n = 3
1
1 2
1 2 3
*/
#include<stdio.h>
int main()
{
int n , i , j ;
scanf("%d" , &n);
} // j
printf("\n");
} // i
}
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
1. n=3
i=1 1
i=2 1 2
i=3 1 2 3
2 2
3 3 3
printf("%4d" , i);
---------------------------------------------------------------
3. 3
3 3
3 3 3
printf("%4d" , n);
---------------------------------------------------------------
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
4. 1
2 3
4 5 6
int t = 1 ;
printf("%4d" , t);
t++;
------------------------------------------------------------------
5.
A
B C %4c
D E F
or
65
66 67 %4d
68 69 70
int t = 65 ; // char t = 'A' ;
printf("%4c" , t);
t++;
----------------------------------------------------------------------
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
6.
A
A B %4c
A B C
or
65
65 66 %4d
65 66 67
int t = 64 ;
printf("%4d" , t + j ) ;
---------------------------------------------------------------------
7.
A
B B
C C C
int t = 64 ;
printf("%4c",t+i);
-----------------------------------------------------------------------
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
8. n = 4
0 1
1 0 1
0 1 0 1
-----------------------------------------------------------------------
*/
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
/*
------------------------------------------------------------------------
WAP TO PRINT TRIAGLE n = 3
1
2 2
3 3 3
------------------------------------------------------------------------
*/
#include<stdio.h>
int main()
{
int n , i , j ;
printf(" ENTER NO OF ROWS \n ");
scanf("%d" , &n);
for( i = 1 ; i <= n ; i++ ) // NO. OF ROWS
{
for( j = 1 ; j <= i ; j++)
{
printf("%4d",i);
} // j
printf("\n");
} // i
}
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
/*
------------------------------------------------------------------------
WAP TO PRINT TRIAGLE n = 3
1
23
45 6
------------------------------------------------------------------------
*/
#include<stdio.h>
int main()
{
int n , i , j ,t = 1 ;
printf(" ENTER NO OF ROWS \n ");
scanf("%d" , &n);
printf("\n");
} // i
}
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
/*
------------------------------------------------------------------------
WAP TO PRINT TRIAGLE n = 3
A
B C
D E F
------------------------------------------------------------------------
*/
#include<stdio.h>
int main()
{
int n , i , j ,t = 65 ;
printf(" ENTER NO OF ROWS \n ");
scanf("%d" , &n);
printf("\n");
} // i
}
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
/*
------------------------------------------------------------------------
WAP TO PRINT TRIAGLE n = 3
A
A B
A B C
------------------------------------------------------------------------
*/
#include<stdio.h>
int main()
{
int n , i , j ,t ;
printf(" ENTER NO OF ROWS \n ");
scanf("%d" , &n);
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
/*
------------------------------------------------------------------------
WAP TO PRINT TRIAGLE n = 3
A
B B
C C C
------------------------------------------------------------------------
*/
#include<stdio.h>
int main()
{
int n , i , j ,t ;
printf(" ENTER NO OF ROWS \n ");
scanf("%d" , &n);
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
WAP TO PRINT TRIAGLE n = 3
1
0 1
1 0 1
#include<stdio.h>
int main()
{
int i , j , n ;
printf(" ENTER NO. OF ROWS \n ");
scanf("%d", &n);
i=3 j = 1 to 3
j = 1 (3+1+1)%2 = 1
j = 2 (3+2+1)%2 = 0
j = 3 (3+3+1)%2 = 1
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com
Sameer Sir Classes, Jabalpur
Auth Exam Center Oracle, Microsoft
9407077858
Training for – Programming in C, Cpp, DSA, Java, Python,Linux,Oracle SQL ,CAMPUS and GATE
Internship, Industrial Training, Project Development
https://www.imgjbp.com