Skip to main content

Posts

Printing reverse matrix In C

Printing reverse matrix In C #include<stdio.h> #include<conio.h> void main() { clrscr(); int n,j; int maxstars=n; int pspace=maxstars/2; int phieght=maxstars-pspace; int i,k,l; for(i=phieght;i>=1;i--) { for(j=pspace;j>=1;j--) { printf(" "); } for(k=1;k<=maxstars;k++) { printf("*");

Getting student Detail Using Structure In C

Getting student Detail Using Structure In C #include<stdio.h> #include<conio.h> void main() { int i,j,total=0; for(i=0;i<5;i++) { printf("enter the name"); scanf("%s"&s[i].name); printf("enter the roll no"); scanf("%d",&s[i].roll no); printf("enter the 5 subject marks"); for(j=0;j<5;j++) { scanf("%d",&s[i].marks[j]); for(i=0;i<5;i++) { printf("name is %s"s[i].name); printf("roll no is %d",s[i].roll no); total=0; for(j=0;j<s;j++) { total=total+s[i].marks[j]; } printf("marks is %d",s[i].marks[j]; { printf("total marks is %d",marks); } getch(); }

Concatenation Using Inbuilt Function

Concatenation Using Inbuilt Function #include<string.h> #include<stdio.h> #include<conio.h> #include<iostream.h> void main() { clrscr(); char a[100],b[100]; cout<<"enter the first string"; gets(a); cout<<"enter the second string"; gets(b); strcat(a,b); cout<<a; getch(); }

Concatenation Of String

Concatenation Of String #include<iostream.h> #include<conio.h> #include<string.h> void main() { clrscr(); string str1="programming"; string str2="hub"; string str3; int len; str3=str1; cout<<str3; str3=str1+str2; cout<<str3<<endl; len=str3.size(); cout<<len<<endl; getch(); }